From: Johan Malm Date: Mon, 14 Aug 2023 22:38:55 +0000 (+0100) Subject: cursor: prevent press on layer-subsurface from cancelling popup grab X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=a89bcc3c60a148590cf58c7fc522c435a65ccffa;p=proto%2Flabwc.git cursor: prevent press on layer-subsurface from cancelling popup grab Fixes: #1030 --- diff --git a/include/ssd.h b/include/ssd.h index 814c6ca2..d63c74bc 100644 --- a/include/ssd.h +++ b/include/ssd.h @@ -36,6 +36,7 @@ enum ssd_part_type { LAB_SSD_MENU, LAB_SSD_OSD, LAB_SSD_LAYER_SURFACE, + LAB_SSD_LAYER_SUBSURFACE, LAB_SSD_UNMANAGED, LAB_SSD_END_MARKER }; diff --git a/src/cursor.c b/src/cursor.c index fedf5ad4..38323a02 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -922,8 +922,12 @@ cursor_button_press(struct seat *seat, struct wlr_pointer_button_event *event) seat_set_focus_layer(seat, layer); } } + if (ctx.type == LAB_SSD_LAYER_SUBSURFACE) { + seat_focus_surface(seat, ctx.surface); + } - if (ctx.type != LAB_SSD_CLIENT && wlr_seat_pointer_has_grab(seat->seat)) { + if (ctx.type != LAB_SSD_CLIENT && ctx.type != LAB_SSD_LAYER_SUBSURFACE + && wlr_seat_pointer_has_grab(seat->seat)) { /* * If we have an active popup grab (an open popup) we want to * cancel that grab whenever the user presses on anything that diff --git a/src/desktop.c b/src/desktop.c index 9493b696..7c6e944e 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -423,6 +423,7 @@ get_cursor_context(struct server *server) * setting the margin with the pointer. */ ret.surface = surface; + ret.type = LAB_SSD_LAYER_SUBSURFACE; return ret; } }