From 3478c3ca5c2383c5340d1deaa22099d93bb2972f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 10 May 2021 20:29:38 +0100 Subject: gtk4: use GTK_POPOVER_MENU_NESTED to avoid crash on submenus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gtk_popover_menu_new crashes on submenus with: "signal 'action-added' is invalid for instance of type 'GtkActionMuxer'" Change-Id: I5d66b727dc45ac539b11e08665d69e019f5dded6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115362 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtksalmenu.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/unx/gtk3/gtksalmenu.cxx b/vcl/unx/gtk3/gtksalmenu.cxx index ac28c3ca5961..a5e7376a79c0 100644 --- a/vcl/unx/gtk3/gtksalmenu.cxx +++ b/vcl/unx/gtk3/gtksalmenu.cxx @@ -430,7 +430,8 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const tools::Rectangl GtkWidget *pWidget = gtk_menu_new_from_model(mpMenuModel); gtk_menu_attach_to_widget(GTK_MENU(pWidget), mpFrame->getMouseEventWidget(), nullptr); #else - GtkWidget *pWidget = gtk_popover_menu_new_from_model(mpMenuModel); + // TODO: gtk_popover_menu_new crashes on submenus with: "signal 'action-added' is invalid for instance of type 'GtkActionMuxer'" + GtkWidget *pWidget = gtk_popover_menu_new_from_model_full(mpMenuModel, GTK_POPOVER_MENU_NESTED); gtk_widget_set_parent(pWidget, mpFrame->getMouseEventWidget()); #endif gtk_widget_insert_action_group(mpFrame->getMouseEventWidget(), "win", mpActionGroup); -- cgit