diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-01 17:24:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-01 17:30:20 +0000 |
commit | 0861cb6d72f0d718928a1998c8a0e2c690e8b09f (patch) | |
tree | 8d162cc56731deb5eb7767f85546b807a865a571 /vcl/unx | |
parent | 45de3417e31337db4310fc77a048ea9d1e6772bb (diff) |
fix crash with gtk3, opengl and presentation console
PresenterSlideShowView::PaintInnerWindow has a mbIsForcedPaintPending flag
which is used to throw away the console canvas, but for other backends the
paint occurs at a much different time after a clear has a chance to get
triggered, while for gtk3 it happens as its being setup.
hack around this presenter console weirdness by skipping the initial
paint for this salsysobj case
Change-Id: If1b23600ef07241e52d92bd5eb38b9e90d9ed192
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkobject.cxx | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 16bca09df2f7..a74555f23531 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -985,6 +985,7 @@ void GtkSalFrame::InitCommon() { m_pSurface = nullptr; m_nGrabLevel = 0; + m_bSalObjectSetPosSize = false; m_aDamageHandler.handle = this; m_aDamageHandler.damaged = ::damaged; @@ -2895,6 +2896,8 @@ void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer pThis->maGeometry.nHeight = pAllocation->height; pThis->AllocateFrame(); pThis->CallCallbackExc( SalEvent::Resize, nullptr ); + if (pThis->m_bSalObjectSetPosSize) + return; pThis->TriggerPaintEvent(); } @@ -4298,4 +4301,11 @@ long GtkSalFrame::CallCallbackExc(SalEvent nEvent, const void* pEvent) const return nRet; } +void GtkSalFrame::nopaint_container_resize_children(GtkContainer *pContainer) +{ + m_bSalObjectSetPosSize = true; + gtk_container_resize_children(pContainer); + m_bSalObjectSetPosSize = false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx index 039a4ba0a934..4a8d0fdc28f3 100644 --- a/vcl/unx/gtk3/gtk3gtkobject.cxx +++ b/vcl/unx/gtk3/gtk3gtkobject.cxx @@ -30,8 +30,9 @@ #include <unx/gtk/gtkgdi.hxx> GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - : m_pSocket( nullptr ), - m_pRegion( nullptr ) + : m_pSocket(nullptr) + , m_pParent(pParent) + , m_pRegion(nullptr) { if( pParent ) { @@ -136,7 +137,7 @@ void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight ) GtkFixed* pContainer = GTK_FIXED(gtk_widget_get_parent(m_pSocket)); gtk_fixed_move( pContainer, m_pSocket, nX, nY ); gtk_widget_set_size_request( m_pSocket, nWidth, nHeight ); - gtk_container_resize_children( GTK_CONTAINER(pContainer) ); + m_pParent->nopaint_container_resize_children(GTK_CONTAINER(pContainer)); } } |