summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3/gtksalmenu.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-10 10:13:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-10 12:45:42 +0200
commitb9b7f6b36af919c1e99a8918986d22a58a9fb95c (patch)
tree44d334bfcc32af7b4ab3ff4b69ce234ef3773015 /vcl/unx/gtk3/gtksalmenu.cxx
parent3cd6402c5443c8069c07d9e420d5ef5b43af6bef (diff)
gtk4: get toplevel menubar and menus working
with gtk_popover_menu_bar_new_from_model doesn't look great, long menus don't seem to scroll or anything like that, but the entries do work Change-Id: I69d6c324b9fe556067ded9acdf1af574ed784a09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115312 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3/gtksalmenu.cxx')
-rw-r--r--vcl/unx/gtk3/gtksalmenu.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx
index c02ea2004cb9..24e173711687 100644
--- a/vcl/unx/gtk3/gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtksalmenu.cxx
@@ -1133,10 +1133,13 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
mpFrame->SetMenu( this );
mpFrame->EnsureAppMenuWatch();
-#if !GTK_CHECK_VERSION(4, 0, 0)
// Clean menu model and action group if needed.
GtkWidget* pWidget = mpFrame->getWindow();
- GdkWindow* gdkWindow = gtk_widget_get_window( pWidget );
+#if !GTK_CHECK_VERSION(4,0,0)
+ GdkSurface* gdkWindow = gtk_widget_get_window( pWidget );
+#else
+ GdkSurface* gdkWindow = gtk_native_get_surface(gtk_widget_get_native(pWidget));
+#endif
GLOMenu* pMenuModel = G_LO_MENU( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) );
GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-action-group" ) );
@@ -1167,7 +1170,6 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
DestroyMenuBarWidget();
CreateMenuBarWidget();
}
-#endif
}
const GtkSalFrame* GtkSalMenu::GetFrame() const