desktop: Make popup grab follow keyboard focus semantics

A popup grab is specified to have the top most popup surface gain
keyboard focus. This means the keyboard focus should always follow the
most recent xdg_popup.grab() surface. Make sure this happens by keeping
track of the parent surface in the libweston-desktop popup grab,
updating the keyboard focus when surfaces are added and removed from the
popup chain, and restoring the keyboard focus to the toplevel when there
are no popups anymore.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2 jobs from wip/keyboard-focus-follows-popup in 4 minutes and 37 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Build
failed #119861
build-native-autotools

00:02:37

failed #119862
build-native-meson

00:02:00

 
Name Stage Failure
failed
build-native-meson Build
[406/413] Linking target tests/test-surface-global.so.
[407/413] Linking target tests/test-ivi-layout-internal.so.
[408/413] Linking target tests/test-ivi-layout.so.
ninja: build stopped: cannot make progress due to previous errors.
Uploading artifacts...
build-*/meson-logs: found 2 matching files
prefix-*: found 54 matching files
Uploading artifacts to coordinator... ok id=119862 responseStatus=201 Created token=Tq1eM6WS
ERROR: Job failed: exit code 1
failed
build-native-autotools Build
make: *** [all] Error 2
Makefile:3582: recipe for target 'all' failed
Uploading artifacts...
WARNING: build-*/weston-*.tar.xz: no matching files
build-*/*.log: found 1 matching files
WARNING: build-*/logs: no matching files
prefix-*: found 54 matching files
Uploading artifacts to coordinator... ok id=119861 responseStatus=201 Created token=JQtgZDww
ERROR: Job failed: exit code 1