summaryrefslogtreecommitdiff
path: root/kiosk-shell
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2021-11-12 15:15:20 +0200
committerMarius Vlad <marius.vlad@collabora.com>2021-11-12 15:22:53 +0200
commit79cf52e5566742bdbf98bce7ad7f61a5e0106448 (patch)
tree3cc77560ed379879d164aa0c7b3a01bc5ef86801 /kiosk-shell
parent365f445eab3faaa3aa7bfac6018f293b3f16d4b7 (diff)
downloadweston-79cf52e5566742bdbf98bce7ad7f61a5e0106448.tar.gz
kiosk-shell: Handle child top-level windows at destruction
With the seperation of surface activation and keyboard input, a special corner case arose for child top-level windows when surfaces are being destroyed. To make sure we never pick the wrong window to activate upon destruction, we verify if the current focused surface is different than the one being destroyed. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'kiosk-shell')
-rw-r--r--kiosk-shell/kiosk-shell.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c
index a2de28ec..eed0f0aa 100644
--- a/kiosk-shell/kiosk-shell.c
+++ b/kiosk-shell/kiosk-shell.c
@@ -652,6 +652,14 @@ find_focus_successor(struct weston_layer *layer,
struct weston_view *top_view = NULL;
struct weston_view *view;
+ /* we need to take into account that the surface being destroyed it not
+ * always the same as the focus_surface, which could result in picking
+ * and *activating* the wrong window, so avoid returning a view for
+ * that case. A particular case is when a top-level child window, would
+ * pick a parent window below the focused_surface. */
+ if (focused_surface != shsurf->view->surface)
+ return top_view;
+
wl_list_for_each(view, &layer->view_list.link, layer_link.link) {
struct kiosk_shell_surface *view_shsurf;
struct kiosk_shell_surface *root;