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
4 jobs for window-activate-grab-4-again-3 in 20 minutes and 12 seconds (queued for 2 seconds)
latest
Status Job ID Name Coverage
  Build
passed #156837
fedora-x86_64

00:05:45

passed #156838
win32
msys2-mingw32

00:14:46

 
  Flatpak
passed #156839
flatpak:demo

00:05:24

passed #156840
flatpak:widget-factory

00:03:44