From b38ed8b4792928dca3e1580e8160792ea41e25c4 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Wed, 6 Dec 2023 14:28:59 -0500 Subject: scene_graph: Port xdg_shell --- sway/input/cursor.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sway/input') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 30df76f4..fd8f50d4 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -80,6 +80,7 @@ struct sway_node *node_at_coords( while (true) { struct sway_container *con = scene_descriptor_try_get(current, SWAY_SCENE_DESC_CONTAINER); + if (!con) { struct sway_view *view = scene_descriptor_try_get(current, SWAY_SCENE_DESC_VIEW); @@ -88,12 +89,18 @@ struct sway_node *node_at_coords( } } - if (con) { - if (!con->view || con->view->surface) { - return &con->node; + if (!con) { + struct sway_xdg_popup *popup = + scene_descriptor_try_get(current, SWAY_SCENE_DESC_POPUP); + if (popup) { + con = popup->view->container; } } + if (con && (!con->view || con->view->surface)) { + return &con->node; + } + if (scene_descriptor_try_get(current, SWAY_SCENE_DESC_LAYER_SHELL)) { // We don't want to feed through the current workspace on // layer shells -- cgit v1.2.3