Skip to content

gdk: switch focus to contextual menu

in addition to taking a grab, to make sure that it is considered active and not other toplevels, notably by the accessibility layer.

01455399 ("gdk: do not deactivate surface on keyboard grabs") disabled deactivating surfaces when a grab is ongoing, to avoid noise when using desktop keyboard shortcuts. When the application itself is grabbing the keyboard from another toplevel, very notably for contextual menus, we however do want to deactivate the current surface, so that the grabbing toplevel shows up as having the focus.

This also fixes a bug in gdk_x11_surface_focus: when the surface is temporary, the window manager does not handle it and will ignore any wm hint, so we need to directly use XSetInputFocus.

Fixes #85

Merge request reports