summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-24 21:22:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-25 12:57:04 +0000
commit7f39d6831e03cbea408ff499df1c5b120d825cee (patch)
tree7ed1f1284c9a5109a3575ccb058c39fb204e3e50 /vcl
parenta3781a7ff856c9d808c836acda35706477229513 (diff)
gtk3: put all of our existing toplevel stuff inside a GtkGrid
so we can optionally insert a native menubar above it all Change-Id: Ib8486d7164493db79c868715a2aef209d7472c01
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx3
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx12
2 files changed, 13 insertions, 2 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index f6da61e4fd2c..a5302147f5c3 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -171,6 +171,9 @@ class GtkSalFrame : public SalFrame
SalX11Screen m_nXScreen;
GtkWidget* m_pWindow;
+#if GTK_CHECK_VERSION(3,0,0)
+ GtkGrid* m_pTopLevelGrid;
+#endif
GtkEventBox* m_pEventBox;
GtkFixed* m_pFixedContainer;
GdkWindow* m_pForeignParent;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index a2c7f9dc819d..3322b2a7b2d3 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -833,6 +833,8 @@ GtkSalFrame::~GtkSalFrame()
gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) );
if( m_pEventBox )
gtk_widget_destroy( GTK_WIDGET(m_pEventBox) );
+ if( m_pTopLevelGrid )
+ gtk_widget_destroy( GTK_WIDGET(m_pTopLevelGrid) );
{
SolarMutexGuard aGuard;
#if defined ENABLE_GMENU_INTEGRATION
@@ -986,10 +988,15 @@ void GtkSalFrame::InitCommon()
m_aDamageHandler.handle = this;
m_aDamageHandler.damaged = ::damaged;
+ m_pTopLevelGrid = GTK_GRID(gtk_grid_new());
+ gtk_container_add(GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pTopLevelGrid));
+
m_pEventBox = GTK_EVENT_BOX(gtk_event_box_new());
gtk_widget_add_events( GTK_WIDGET(m_pEventBox),
GDK_ALL_EVENTS_MASK );
- gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pEventBox) );
+ gtk_widget_set_vexpand(GTK_WIDGET(m_pEventBox), true);
+ gtk_widget_set_hexpand(GTK_WIDGET(m_pEventBox), true);
+ gtk_grid_attach(m_pTopLevelGrid, GTK_WIDGET(m_pEventBox), 0, 0, 1, 1);
// add the fixed container child,
// fixed is needed since we have to position plugin windows
@@ -1092,7 +1099,7 @@ void GtkSalFrame::InitCommon()
);
// show the widgets
- gtk_widget_show_all( GTK_WIDGET(m_pEventBox) );
+ gtk_widget_show_all(GTK_WIDGET(m_pTopLevelGrid));
// realize the window, we need an XWindow id
gtk_widget_realize( m_pWindow );
@@ -3421,6 +3428,7 @@ void GtkSalFrame::signalDestroy( GtkWidget* pObj, gpointer frame )
{
pThis->m_pFixedContainer = nullptr;
pThis->m_pEventBox = nullptr;
+ pThis->m_pTopLevelGrid = nullptr;
pThis->m_pWindow = nullptr;
pThis->InvalidateGraphics();
}