diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-19 09:53:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-19 09:55:04 +0100 |
commit | c70a5937e3a2057886c01bc78ac5a6b42e8c702d (patch) | |
tree | a126cd2f83109a778d7432a75ebf5b70a38ddbff /vcl | |
parent | 3fae8c02855360c4573932ae0f518a45658cfbe5 (diff) |
gtk3: for x11 case set Display and Visual so opengl slide effects can work
Change-Id: Ib354a3bc0e2069117717068d7cfc02623765a6fa
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkobject.cxx | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 36754f9f6c2f..7eaa53cd1b2b 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -1088,6 +1088,18 @@ void GtkSalFrame::InitCommon() m_aSystemData.pAppContext = nullptr; m_aSystemData.pShellWidget = m_aSystemData.pWidget; m_aSystemData.pToolkit = "gtk3"; + GdkScreen* pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow)); + GdkVisual* pVisual = gdk_screen_get_system_visual(pScreen); + m_aSystemData.nDepth = gdk_visual_get_depth(pVisual); + +#if defined(GDK_WINDOWING_X11) + GdkDisplay *pDisplay = getGdkDisplay(); + if (GDK_IS_X11_DISPLAY(pDisplay)) + { + m_aSystemData.pDisplay = gdk_x11_display_get_xdisplay(pDisplay); + m_aSystemData.pVisual = gdk_x11_visual_get_xvisual(pVisual); + } +#endif m_bGraphics = false; m_pGraphics = nullptr; diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx index bf3fbbeb7a74..1c51b112f28e 100644 --- a/vcl/unx/gtk3/gtk3gtkobject.cxx +++ b/vcl/unx/gtk3/gtk3gtkobject.cxx @@ -55,6 +55,18 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) m_aSystemData.pAppContext = nullptr; m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); m_aSystemData.pToolkit = "gtk3"; + GdkScreen* pScreen = gtk_window_get_screen(GTK_WINDOW(pParent->getWindow())); + GdkVisual* pVisual = gdk_screen_get_system_visual(pScreen); + m_aSystemData.nDepth = gdk_visual_get_depth(pVisual); + +#if defined(GDK_WINDOWING_X11) + GdkDisplay *pDisplay = pParent->getGdkDisplay(); + if (GDK_IS_X11_DISPLAY(pDisplay)) + { + m_aSystemData.pDisplay = gdk_x11_display_get_xdisplay(pDisplay); + m_aSystemData.pVisual = gdk_x11_visual_get_xvisual(pVisual); + } +#endif g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this ); g_signal_connect( G_OBJECT(m_pSocket), "button-release-event", G_CALLBACK(signalButton), this ); |