From cdaf08f254981d920918fcfdb1aa356dfdf66306 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 30 Aug 2018 18:11:29 +0200 Subject: menu-bar: transfer focus correctly on alt-F1 The background is in https://gitlab.gnome.org/GNOME/gtk/issues/85 . One of the conclusions, in https://gitlab.gnome.org/GNOME/gtk/issues/85#note_264804 , is that mate-panel needs to properly transfer focus on alt-F1 keyboard shortcut. It used to work only by luck before, only because gtk used to deactivate itself during a keyboard grab. But as discussed in https://gitlab.gnome.org/GNOME/gtk/issues/85 that behavior poses accessibility feedback issues, is not coherent, and keyboard grab feedback will not be available in wayland anyway. Thus @ebassi saying in https://gitlab.gnome.org/GNOME/gtk/issues/85#note_264804 that not transferring focus properly is the actual bug. This change explictly switches to the menu bar after saving which X Window had the focus, and on menu bar deactivation restores focus to that X Window. Fixes #851 This a backport of commit f0f4c5e1217eefd46edf9f98633fb32967c67461. --- mate-panel/panel-util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mate-panel/panel-util.h') diff --git a/mate-panel/panel-util.h b/mate-panel/panel-util.h index 8d9fb2ef..fb1303a3 100644 --- a/mate-panel/panel-util.h +++ b/mate-panel/panel-util.h @@ -3,6 +3,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -66,6 +67,10 @@ void panel_util_set_tooltip_text (GtkWidget *widget, GFile *panel_util_get_file_optional_homedir (const char *location); +Window panel_util_get_current_active_window (GtkWidget *toplevel); + +void panel_util_set_current_active_window (GtkWidget *toplevel, + Window window); #ifdef __cplusplus } #endif -- cgit v1.2.1