From 1d9c9d1afc1041f5e7dbb737ce9e753cd5dd7064 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Thu, 24 Feb 2022 21:01:37 +0100 Subject: [PATCH] Implement cursor input for overlay popups --- src/desktop.c | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/desktop.c b/src/desktop.c index 0576eb68..6f1c873b 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -358,6 +358,14 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly, wlr_output_layout_output_coords(output->server->output_layout, wlr_output, &ox, &oy); + /* Overlay-layer popups */ + *surface = layer_surface_popup_at(output, + &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], + ox, oy, sx, sy); + if (*surface) { + return NULL; + } + /* Overlay-layer */ *surface = layer_surface_at( &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], @@ -366,6 +374,26 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly, return NULL; } + /* Check for other layer popups */ + *surface = layer_surface_popup_at(output, + &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + ox, oy, sx, sy); + if (*surface) { + return NULL; + } + *surface = layer_surface_popup_at(output, + &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + ox, oy, sx, sy); + if (*surface) { + return NULL; + } + *surface = layer_surface_popup_at(output, + &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + ox, oy, sx, sy); + if (*surface) { + return NULL; + } + /* Check for unmanaged surfaces */ #if HAVE_XWAYLAND struct xwayland_unmanaged *unmanaged_surface; @@ -382,26 +410,6 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly, } #endif - /* Check all layer popups */ - *surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], - ox, oy, sx, sy); - if (*surface) { - return NULL; - } - *surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], - ox, oy, sx, sy); - if (*surface) { - return NULL; - } - *surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], - ox, oy, sx, sy); - if (*surface) { - return NULL; - } - /* Top-layer */ *surface = layer_surface_at( &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], @@ -410,6 +418,7 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly, return NULL; } + /* Usual views */ struct view *view; wl_list_for_each (view, &server->views, link) { if (!view->mapped) { @@ -432,6 +441,7 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly, } } + /* Bottom and Background layers */ *surface = layer_surface_at( &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], ox, oy, sx, sy);