summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3/gtkframe.cxx
diff options
context:
space:
mode:
authorVincent Reher <lo@4reher.org>2022-04-05 18:31:45 -0700
committerCaolán McNamara <caolanm@redhat.com>2022-04-06 10:43:27 +0200
commit2703f729e9ea0bbc1f64b04b535a676a2980e1b8 (patch)
treebc2cf24407c7b1838599052f1bc32be7f5a2059f /vcl/unx/gtk3/gtkframe.cxx
parentfbf739198aa7f02975d531521c6525073783c7f1 (diff)
Resolves: tdf#146174 allow shortcut key event handling before menubar
Change-Id: Ib0dadafcc66604baf53169cb222a059ee3f97362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132615 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3/gtkframe.cxx')
-rw-r--r--vcl/unx/gtk3/gtkframe.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 29d6c00f78d7..35e761ede5fd 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3899,12 +3899,6 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe
if (GTK_IS_WINDOW(pThis->m_pWindow))
{
- // tdf#144846 If this is registered as a menubar mnemonic then ensure
- // that any other widget won't be considered as a candidate by taking
- // over the task of launch the menubar menu outself
- if (pThis->HandleMenubarMnemonic(pEvent->state, pEvent->keyval))
- return true;
-
GtkWidget* pFocusWindow = gtk_window_get_focus(GTK_WINDOW(pThis->m_pWindow));
bFocusInAnotherGtkWidget = pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer);
if (bFocusInAnotherGtkWidget)
@@ -4056,6 +4050,20 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe
sal_Unicode(gdk_keyval_to_unicode( pEvent->keyval )),
(pEvent->type == GDK_KEY_PRESS),
false);
+
+ // tdf#144846 If this is registered as a menubar mnemonic then ensure
+ // that any other widget won't be considered as a candidate by taking
+ // over the task of launch the menubar menu outself
+ // The code was moved here from its original position at beginning
+ // of this function in order to resolve tdf#146174.
+ if (!bStopProcessingKey && // module key handler did not process key
+ pEvent->type == GDK_KEY_PRESS && // module key handler handles only GDK_KEY_PRESS
+ GTK_IS_WINDOW(pThis->m_pWindow) &&
+ pThis->HandleMenubarMnemonic(pEvent->state, pEvent->keyval))
+ {
+ return true;
+ }
+
if (!aDel.isDeleted())
{
pThis->m_nKeyModifiers = ModKeyFlags::NONE;