diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-10-01 02:04:26 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-11-14 13:52:50 +0100 |
commit | 64eb789f1ca92fb7a2e5f650af9a20fcc4b65d83 (patch) | |
tree | a5e7f3540603817a702909a654bb796bd85534a0 /vcl/unx | |
parent | 05888c86739f5ec77d96b62a997e8fce90d090c1 (diff) |
grab model from frame on update
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 6fcc542fc3d6..eaa2aa2d7b45 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -478,6 +478,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) Init( pSysData ); } +#if !GTK_CHECK_VERSION(3,0,0) static void gdk_x11_window_set_utf8_property (GdkWindow *window, const gchar *name, @@ -500,6 +501,7 @@ gdk_x11_window_set_utf8_property (GdkWindow *window, gdk_x11_get_xatom_by_name_for_display (display, name)); } } +#endif // AppMenu watch functions. diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index bb896feb8d09..0f3056b5254f 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -75,11 +75,29 @@ rtl::OUString GetGtkKeyName( rtl::OUString keyName ) return aGtkKeyName; } -static void UpdateNativeMenu2( GtkSalMenu *pMenu ) +void UpdateNativeMenu2( GtkSalMenu *pMenu ) { if ( pMenu == NULL ) return; - + if (!pMenu->mpFrame) + return; + GObject* pWindow = G_OBJECT(gtk_widget_get_window( GTK_WIDGET(pMenu->mpFrame->getWindow()) )); + if(!pWindow) + return; + if(pMenu->mbMenuBar) + { + Menu* pVCLMenu = pMenu->GetMenu(); + pMenu->mpMenuModel = G_MENU_MODEL( g_object_get_data( G_OBJECT( pWindow ), "g-lo-menubar" ) ); + pMenu->mpActionGroup = G_ACTION_GROUP( g_object_get_data( G_OBJECT( pWindow ), "g-lo-action-group" ) ); + //std::cout << "updating root menu model" << mpMenuModel << std::endl; + } + else + { + if(!pMenu->mpActionGroup) + return; + if(!pMenu->mpMenuModel) + return; + } Menu* pVCLMenu = pMenu->GetMenu(); GLOMenu* pLOMenu = G_LO_MENU( pMenu->GetMenuModel() ); GActionGroup* pActionGroup = pMenu->GetActionGroup(); |