vcl/unx/gtk3/gtk3gtkframe.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit b96797dd2e6578e8e1a4cea0fa2f3a17bc194a1c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Apr 29 14:17:40 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Apr 29 20:58:48 2021 +0200 tdf#141963 put focus in vcl parent during Function key processing Change-Id: Ib63567c9ce208cb7dd522a1bce9d99fa44a72554 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114883 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index d33704743b84..fa46f1372fe1 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 ) { @@ -3271,8 +3276,9 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe // 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 F6 to switch between task-panels - if (pThis->IsCycleFocusOutDisallowed() || pEvent->keyval == GDK_KEY_F6) + // 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits