diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-29 14:17:40 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2021-05-06 02:49:13 +0200 |
commit | 1dd4bfc1fc4b9ba178fb8ee3b24b85aa3ef0c115 (patch) | |
tree | ad4487f1670ee6caef3cf5e9eaa917f3cbcac147 /vcl | |
parent | e24a8d1484befe9e2bbb1937ace5493ea7b5f80d (diff) |
tdf#141963 put focus in vcl parent during Function key processing
Change-Id: Ib63567c9ce208cb7dd522a1bce9d99fa44a72554
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114884
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index f0c9d9fd3155..8637acd77684 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -94,6 +94,12 @@ sal_uInt16 GtkSalFrame::GetMouseModCode( guint state ) return nCode; } +// KEY_F26 is the last function key known to keycodes.hxx +static bool IsFunctionKeyVal(guint keyval) +{ + return keyval >= GDK_KEY_F1 && keyval <= GDK_KEY_F26; +} + sal_uInt16 GtkSalFrame::GetKeyCode(guint keyval) { sal_uInt16 nCode = 0; @@ -105,8 +111,7 @@ sal_uInt16 GtkSalFrame::GetKeyCode(guint keyval) nCode = KEY_A + (keyval-GDK_KEY_A ); else if( keyval >= GDK_KEY_a && keyval <= GDK_KEY_z ) nCode = KEY_A + (keyval-GDK_KEY_a ); - else if( keyval >= GDK_KEY_F1 && keyval <= GDK_KEY_F26 ) - // KEY_F26 is the last function key known to keycodes.hxx + else if (IsFunctionKeyVal(keyval)) { switch( keyval ) { @@ -3259,10 +3264,13 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe if (bHandled) return true; - // Is focus inside a full-app InterimItemWindow? In which case find - // that InterimItemWindow and send unconsumed keystrokes to it to - // support ctrl-q etc shortcuts - if (pThis->IsCycleFocusOutDisallowed()) + // Is focus inside an InterimItemWindow? In which case find that + // InterimItemWindow and send unconsumed keystrokes to it to + // support ctrl-q etc shortcuts. Only bother to search for the + // InterimItemWindow if it is a toplevel that fills its frame, or + // the keystroke is sufficiently special its worth passing on, + // e.g. F6 to switch between task-panels or F5 to close a navigator + if (pThis->IsCycleFocusOutDisallowed() || IsFunctionKeyVal(pEvent->keyval)) { GtkWidget* pSearch = pFocusWindow; while (pSearch) |