summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-01 17:24:26 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-02 16:58:40 +0000
commite6ecdaa1f8a6e78883fc7952b125151ced30d606 (patch)
tree9cf3e1f6dedd5fcf3537be5b5a57081b2cf4a051
parent38e7b2db19b85088cdf98dc1a8080e54f92c8714 (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 (cherry picked from commit 0861cb6d72f0d718928a1998c8a0e2c690e8b09f) Reviewed-on: https://gerrit.libreoffice.org/33804 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx2
-rw-r--r--vcl/inc/unx/gtk/gtkobject.hxx1
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx10
-rw-r--r--vcl/unx/gtk3/gtk3gtkobject.cxx7
4 files changed, 17 insertions, 3 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 74649cb9d45d..3deb4c4a8c28 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -348,6 +348,7 @@ public:
cairo_surface_t* m_pSurface;
DamageHandler m_aDamageHandler;
int m_nGrabLevel;
+ bool m_bSalObjectSetPosSize;
#endif
GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
GtkSalFrame( SystemParentData* pSysData );
@@ -425,6 +426,7 @@ public:
void addGrabLevel();
void removeGrabLevel();
+ void nopaint_container_resize_children(GtkContainer*);
#endif
virtual ~GtkSalFrame() override;
diff --git a/vcl/inc/unx/gtk/gtkobject.hxx b/vcl/inc/unx/gtk/gtkobject.hxx
index 12a9ff378575..1f300954ba42 100644
--- a/vcl/inc/unx/gtk/gtkobject.hxx
+++ b/vcl/inc/unx/gtk/gtkobject.hxx
@@ -30,6 +30,7 @@ class GtkSalObject : public SalObject
SystemEnvData m_aSystemData;
GtkWidget* m_pSocket;
#if GTK_CHECK_VERSION(3,0,0)
+ GtkSalFrame* m_pParent;
cairo_region_t* m_pRegion;
#else
GdkRegion* m_pRegion;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 6b0af8f19934..1a74fb541f6c 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -982,6 +982,7 @@ void GtkSalFrame::InitCommon()
{
m_pSurface = nullptr;
m_nGrabLevel = 0;
+ m_bSalObjectSetPosSize = false;
m_aDamageHandler.handle = this;
m_aDamageHandler.damaged = ::damaged;
@@ -2892,6 +2893,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();
}
@@ -4283,4 +4286,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));
}
}