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
4 jobs for window-activate-grab-4-2.4 in 48 minutes and 7 seconds (queued for 1 minute and 28 seconds)
Status Job ID Name Coverage
  Build
passed #28034
fedora-x86_64

00:25:14

passed #28035
win32
msys2-mingw32

00:03:41

 
  Flatpak
passed #28036
flatpak:demo

00:22:53

passed #28037
flatpak:widget-factory

00:22:27