Implement cursor input for overlay popups

This commit is contained in:
Consolatis 2022-02-24 21:01:37 +01:00
parent afa3eb1572
commit 417d50dfe9

View file

@ -357,6 +357,14 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly,
wlr_output_layout_output_coords(output->server->output_layout, wlr_output_layout_output_coords(output->server->output_layout,
wlr_output, &ox, &oy); 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 */ /* Overlay-layer */
*surface = layer_surface_at( *surface = layer_surface_at(
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
@ -365,6 +373,26 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly,
return NULL; 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 */ /* Check for unmanaged surfaces */
#if HAVE_XWAYLAND #if HAVE_XWAYLAND
struct xwayland_unmanaged *unmanaged_surface; struct xwayland_unmanaged *unmanaged_surface;
@ -381,26 +409,6 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly,
} }
#endif #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 */ /* Top-layer */
*surface = layer_surface_at( *surface = layer_surface_at(
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP],
@ -409,6 +417,7 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly,
return NULL; return NULL;
} }
/* Usual views */
struct view *view; struct view *view;
wl_list_for_each (view, &server->views, link) { wl_list_for_each (view, &server->views, link) {
if (!view->mapped) { if (!view->mapped) {
@ -431,6 +440,7 @@ desktop_surface_and_view_at(struct server *server, double lx, double ly,
} }
} }
/* Bottom and Background layers */
*surface = layer_surface_at( *surface = layer_surface_at(
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM],
ox, oy, sx, sy); ox, oy, sx, sy);