gdk: activate surface on keyboard grabs
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 1 Jun 2018 14:43:01 +0000 (16:43 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 18 Jun 2018 08:31:15 +0000 (10:31 +0200)
commit35417a5a74bfebd69b5c069d7a2f517ba571bcf9
tree6acdcf6fadff9095f6f18e31ea40d839935d7475
parentf4c1a404465cd622b849179d1ff5256636512ab0
gdk: activate surface on keyboard grabs

In 01455399e83a ("gdk: do not deactivate surface on keyboard grabs"), we
made gdk avoid deactivating surfaces when another application takes a
keyboard grab, by using has_focus_window instead of has_focus. That however
broke activating surfaces when the gdk application acquired a grab itself,
in which case has_focus_window is false but has_focus is true.

We thus actually need to use both: surfaces should be activated either
because we have normal keyboard focus, or because we grabbed the keyboard.

This also renames HAS_FOCUS to APPEARS_FOCUSED to better reflect its
role.

Fixes #85
gdk/x11/gdkdevicemanager-core-x11.c
gdk/x11/gdkeventsource.c