summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-06-22 20:34:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-06-23 16:55:36 +0200
commit92cf12ea025dfda642809d297a015131c1925052 (patch)
treeb4e5b058b4866ef319deb7506fcd2447c532b52e /vcl/unx
parent4f113609feae412a79edbdffcc2f34600c79ee63 (diff)
tdf#125803 deactivate the menu regardless of menu item type
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. so simpler to just dropdown the menus no matter what type was activated, which won't happen in the unity case, but that's presumably mostly gone by now(?) Change-Id: I2ba841dd192c1461ef26d8395ba572843f4c5c4f Reviewed-on: https://gerrit.libreoffice.org/74580 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-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);
}