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
, 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
......
......@@ -30,7 +30,7 @@
SalFrame::SalFrame()
: m_bAwaitingSizeConfirmation(false)
: m_bPaintsBlocked(false)
, m_pWindow(NULL)
, m_pProc(NULL)
{
......
......@@ -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();
}
......
......@@ -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;
......
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