summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-19 14:10:23 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-30 11:17:34 +0200
commitc926b28d965dbae90b17d404d2c6d1e031a6f006 (patch)
tree9c68c223375b0043b962c39c9fc7053e9d472a0c
parentff47cb0c519a0e24bfe2e9d80826ab2954cf3e42 (diff)
downloadgtk+-c926b28d965dbae90b17d404d2c6d1e031a6f006.tar.gz
gdk: do not deactivate surface on keyboard grabs
When pressing e.g. a window manager shortcut, which acquires keyboard grab, Xorg would send FocusOut NotifyGrab then FocusIn NotifyUngrab. Currently gdk would then deactivate the current surface, which makes accessibility screen readers think that we have switched to a non-accessible application and came back again, and thus reannounce the application frame etc. which we don't want when e.g. just raising volume. And actually, receiving FocusOut NotifyGrab does not mean losing the X focus, it only means an application aqcuired a grab, i.e. it is temporarily stealing keyboard events. On Wayland, this isn't even notified actually. This commit makes gdk only deactivate surfaces when there was an actual focus switch to another window, as determined by has_focus_window (instead of just has_focus), which happens either normally through FocusOut with NotifyNormal, or during grabs through FocusOut with NotifyWhileGrabbed. Fixes #85 (cherry picked from commit 01455399e83a3dbafb0cdc6e12c7003b2f472a40)
-rw-r--r--gdk/x11/gdkdevicemanager-core-x11.c2
-rw-r--r--gdk/x11/gdkeventsource.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 350a79b03f..7f7aa048aa 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -30,7 +30,7 @@
#define HAS_FOCUS(toplevel) \
- ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
+ ((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
static void gdk_x11_device_manager_core_finalize (GObject *object);
static void gdk_x11_device_manager_core_constructed (GObject *object);
diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c
index 774d10c528..590e597c75 100644
--- a/gdk/x11/gdkeventsource.c
+++ b/gdk/x11/gdkeventsource.c
@@ -33,7 +33,7 @@ static gboolean gdk_event_source_dispatch (GSource *source,
static void gdk_event_source_finalize (GSource *source);
#define HAS_FOCUS(toplevel) \
- ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
+ ((toplevel)->has_focus_window || (toplevel)->has_pointer_focus)
struct _GdkEventSource
{