summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/gtksalmenu.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index e3d9dc85c087..0d149bf4b30c 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -1220,6 +1220,17 @@ void GtkSalMenu::DispatchCommand(const gchar *pCommand)
MenuAndId aMenuAndId = decode_command(pCommand);
GtkSalMenu* pSalSubMenu = aMenuAndId.first;
GtkSalMenu* pTopLevel = pSalSubMenu->GetTopLevel();
+ if (pTopLevel->mpMenuBarWidget)
+ {
+ // tdf#125803 spacebar will toggle radios and checkbuttons without automatically
+ // closing the menu. To handle this properly I imagine we need to set groups for the
+ // radiobuttons so the others visually untoggle when the active one is togged and
+ // we would further need to teach vcl that the state can change more than once.
+ //
+ // or we could unconditonally deactivate the menus if regardless of what particular
+ // type of menu item got activated
+ gtk_menu_shell_deactivate(GTK_MENU_SHELL(pTopLevel->mpMenuBarWidget));
+ }
pTopLevel->GetMenu()->HandleMenuCommandEvent(pSalSubMenu->GetMenu(), aMenuAndId.second);
}