]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: prevent press on layer-subsurface from cancelling popup grab
authorJohan Malm <jgm323@gmail.com>
Mon, 14 Aug 2023 22:38:55 +0000 (23:38 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 15 Aug 2023 19:25:58 +0000 (20:25 +0100)
Fixes: #1030
include/ssd.h
src/cursor.c
src/desktop.c

index 814c6ca2be2215832f39669087590fadcd1b40dc..d63c74bcab662fc460d760c814d9e8f9b77556cd 100644 (file)
@@ -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
 };
index fedf5ad4625ed9dec9084eb970acb5b3982e5fdc..38323a0236189522a49413d372dc5af784dbe2b4 100644 (file)
@@ -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
index 9493b696ada4de3ec7201c1d8159460a7959d87d..7c6e944edd1d76ecb758da3c80edf1320b0ced52 100644 (file)
@@ -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;
                                }
                        }