Kaydet (Commit) 6dc1d270 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 1303f209
...@@ -102,7 +102,7 @@ class VCL_PLUGIN_PUBLIC SalFrame ...@@ -102,7 +102,7 @@ class VCL_PLUGIN_PUBLIC SalFrame
, public SalGeometryProvider , public SalGeometryProvider
{ {
protected: protected:
bool m_bAwaitingSizeConfirmation; bool m_bPaintsBlocked;
private: private:
// the VCL window corresponding to this frame // the VCL window corresponding to this frame
VclPtr<vcl::Window> m_pWindow; VclPtr<vcl::Window> m_pWindow;
...@@ -246,7 +246,7 @@ public: ...@@ -246,7 +246,7 @@ public:
long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
{ return m_pProc ? long(m_pProc( m_pWindow, const_cast<SalFrame*>(this), nEvent, pEvent )) : 0; } { 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 #endif // INCLUDED_VCL_INC_SALFRAME_HXX
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
SalFrame::SalFrame() SalFrame::SalFrame()
: m_bAwaitingSizeConfirmation(false) : m_bPaintsBlocked(false)
, m_pWindow(NULL) , m_pWindow(NULL)
, m_pProc(NULL) , m_pProc(NULL)
{ {
......
...@@ -587,7 +587,7 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, void) ...@@ -587,7 +587,7 @@ IMPL_LINK_NOARG_TYPED(Window, ImplHandlePaintHdl, Idle *, void)
// save paint events until resizing or initial sizing done // save paint events until resizing or initial sizing done
if (!ImplDoTiledRendering() && mpWindowImpl->mbFrame && if (!ImplDoTiledRendering() && mpWindowImpl->mbFrame &&
(mpWindowImpl->mpFrameData->maResizeIdle.IsActive() || (mpWindowImpl->mpFrameData->maResizeIdle.IsActive() ||
mpWindowImpl->mpFrame->AwaitingSizeConfirmation())) mpWindowImpl->mpFrame->PaintsBlocked()))
{ {
mpWindowImpl->mpFrameData->maPaintIdle.Start(); mpWindowImpl->mpFrameData->maPaintIdle.Start();
} }
......
...@@ -936,23 +936,23 @@ void GtkSalFrame::moveWindow( long nX, long nY ) ...@@ -936,23 +936,23 @@ void GtkSalFrame::moveWindow( long nX, long nY )
void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight) void GtkSalFrame::widget_set_size_request(long nWidth, long nHeight)
{ {
gint nOrigwidth, nOrigheight; gint nOrigwidth, nOrigheight;
gtk_widget_get_size_request(m_pWindow, &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; m_bPaintsBlocked = true;
gtk_widget_set_size_request(m_pWindow, nWidth, nHeight );
} }
gtk_widget_set_size_request(m_pWindow, nWidth, nHeight );
} }
void GtkSalFrame::window_resize(long nWidth, long nHeight) void GtkSalFrame::window_resize(long nWidth, long nHeight)
{ {
gint nOrigwidth, nOrigheight; gint nOrigwidth, nOrigheight;
gtk_window_get_size(GTK_WINDOW(m_pWindow), &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; m_bPaintsBlocked = true;
gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
} }
gtk_window_resize(GTK_WINDOW(m_pWindow), nWidth, nHeight);
} }
void GtkSalFrame::resizeWindow( long nWidth, long nHeight ) void GtkSalFrame::resizeWindow( long nWidth, long nHeight )
...@@ -3535,6 +3535,7 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect) ...@@ -3535,6 +3535,7 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame ) gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame )
{ {
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
pThis->m_bPaintsBlocked = false;
cairo_save(cr); cairo_save(cr);
...@@ -3557,6 +3558,7 @@ gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame ) ...@@ -3557,6 +3558,7 @@ gboolean GtkSalFrame::signalDraw( GtkWidget*, cairo_t *cr, gpointer frame )
gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer frame ) gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer frame )
{ {
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(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 ); 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 ) ...@@ -3709,7 +3711,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame ) gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gpointer frame )
{ {
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
pThis->m_bAwaitingSizeConfirmation = false; pThis->m_bPaintsBlocked = false;
bool bMoved = false, bSized = false; bool bMoved = false, bSized = false;
int x = pEvent->x, y = pEvent->y; int x = pEvent->x, y = pEvent->y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment