Skip to content

a11y: Do not emit window:activate events on temporary grab

Samuel Thibault requested to merge sthibaul/gtk:window-activate-grab into gtk-3-22

When pressing e.g. a window manager shortcut, Xorg would send FocusOut NotifyGrab then FocusIn NotifyUngrab. Currently gtk would then send window:activate/deactivate, which makes the screen reader 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.

This adds a "grab" field to GdkFocusEvent, so that listeners can know when focus events are solely due to temporary grabbing, and let window_focus avoid sending window:activate/deactivate in that case.

Fixes #85

Merge request reports