summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Reher <lo@4reher.org>2022-04-05 18:31:45 -0700
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-04-07 08:26:25 +0200
commit41c00d9cf065a6b5ba676807b446f32426e5d642 (patch)
tree641e4c954e0b4a61e2dbadf8e5674c07b5f02d67
parent37f39a4156069ba5f099045ce93370507d9ba215 (diff)
Resolves: tdf#146174 allow shortcut key event handling before menubar
Change-Id: Ib0dadafcc66604baf53169cb222a059ee3f97362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132602 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-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 a7ba7eec9cdb..c874b23a13c5 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -3785,12 +3785,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_pDrawingArea);
if (bFocusInAnotherGtkWidget)
@@ -3947,6 +3941,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;