summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-15 10:56:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-15 11:11:44 +0100
commit6dc1d2706f519d91617ac1a12fc2051d97ef98c0 (patch)
treeda3bc39c8cc03815845c550c3c64b366188497c7
parent1303f209415b6cf95f9cbe9924d03c87ed4337d6 (diff)
another stab at tdf#91393
block paints only if the new requested size is larger than the original and unblock on explicit expose events as well as configure ones Change-Id: I72829a5b6e55d6bbdaf934af427ee3b50fe11fd4
-rw-r--r--vcl/inc/salframe.hxx4
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/window/paint.cxx2
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx18
4 files changed, 14 insertions, 12 deletions
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index f5213a101851..d576b60a5744 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -102,7 +102,7 @@ class VCL_PLUGIN_PUBLIC SalFrame
, public SalGeometryProvider
{
protected:
- bool m_bAwaitingSizeConfirmation;
+ bool m_bPaintsBlocked;
private:
// the VCL window corresponding to this frame
VclPtr<vcl::Window> m_pWindow;
@@ -246,7 +246,7 @@ public:
long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
{ return m_pProc ? long(m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent )) : 0; }
- bool AwaitingSizeConfirmation() const { return m_bAwaitingSizeConfirmation; }
+ bool PaintsBlocked() const { return m_bPaintsBlocked; }
};
#endif // INCLUDED_VCL_INC_SALFRAME_HXX
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 7a68df22197d..4c5636372a48 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -30,7 +30,7 @@
SalFrame::SalFrame()
- : m_bAwaitingSizeConfirmation(false)
+ : m_bPaintsBlocked(false)
, m_pWindow(NULL)
, m_pProc(NULL)
{
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 2bca30ea2ef0..0bac418c5eed 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -587,7 +587,7 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, void)
// save paint events until resizing or initial sizing done
if (!ImplDoTiledRendering() && mpWindowImpl->mbFrame &&
(mpWindowImpl->mpFrameData->maResizeIdle.IsActive() ||
- mpWindowImpl->mpFrame->AwaitingSizeConfirmation()))
+ mpWindowImpl->mpFrame->PaintsBlocked()))
{
mpWindowImpl->mpFrameData->maPaintIdle.Start();
}
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index d13acf0e37ae..4a658cb06928 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -936,23 +936,23 @@ void GtkSalFrame::moveWindow( long nX, long nY )
void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
{
gint nOrigwidth, nOrigheight;
- gtk_widget_get_size_request(m_pWindow, &nOrigwidth, &nOrigheight);
- if (nOrigwidth != nWidth || nOrigheight != nHeight)
+ gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight);
+ if (nWidth > nOrigwidth || nHeight > nOrigheight)
{
- m_bAwaitingSizeConfirmation = true;
- gtk_widget_set_size_request(m_pWindow, nWidth, nHeight );
+ m_bPaintsBlocked = true;
}
+ gtk_widget_set_size_request(m_pWindow, nWidth, nHeight );
}
void GtkSalFrame::window_resize(long nWidth, long nHeight)
{
gint nOrigwidth, nOrigheight;
gtk_window_get_size(GTK_WINDOW(m_pWindow), &nOrigwidth, &nOrigheight);
- if (nOrigwidth != nWidth || nOrigheight != nHeight)
+ if (nWidth > nOrigwidth || nHeight > nOrigheight)
{
- m_bAwaitingSizeConfirmation = true;
- gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
+ m_bPaintsBlocked = true;
}
+ gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
}
void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
@@ -3535,6 +3535,7 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+ pThis->m_bPaintsBlocked = false;
cairo_save(cr);
@@ -3557,6 +3558,7 @@ gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame )
gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+ pThis->m_bPaintsBlocked = false;
struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height );
@@ -3709,7 +3711,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- pThis->m_bAwaitingSizeConfirmation = false;
+ pThis->m_bPaintsBlocked = false;
bool bMoved = false, bSized = false;
int x = pEvent->x, y = pEvent->y;