]> git.mdlowis.com Git - proto/labwc.git/commitdiff
osd: prevent handling cursor actions in preview mode
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 29 Mar 2024 01:53:53 +0000 (02:53 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 5 May 2024 20:05:32 +0000 (21:05 +0100)
Fixes: #1640
Co-Authored-By: tokyo4j <hrak1529@gmail.com>
src/foreign.c
src/input/cursor.c
src/xdg.c
src/xwayland.c

index f76144a7ba4889fa29430da8c8beb1251b2291f2..982e78403c1f271ff4a2b6a058882e1b011caf12 100644 (file)
@@ -34,6 +34,12 @@ handle_request_activate(struct wl_listener *listener, void *data)
 {
        struct view *view = wl_container_of(listener, view, toplevel.activate);
        // struct wlr_foreign_toplevel_handle_v1_activated_event *event = data;
+
+       if (view->server->osd_state.cycle_view) {
+               wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
+               return;
+       }
+
        /* In a multi-seat world we would select seat based on event->seat here. */
        desktop_focus_view(view, /*raise*/ true);
 }
index 01c3dbe7d22223776cfd51c2221290068fe3bd05..626caeab329a9a361dfcb42704da3f1d6788c83c 100644 (file)
@@ -521,7 +521,8 @@ process_cursor_motion(struct server *server, uint32_t time)
                dnd_icons_move(seat, seat->cursor->x, seat->cursor->y);
        }
 
-       if ((ctx.view || ctx.surface) && rc.focus_follow_mouse) {
+       if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
+                       && !server->osd_state.cycle_view) {
                desktop_focus_view_or_surface(seat, ctx.view, ctx.surface,
                        rc.raise_on_focus);
        }
@@ -798,6 +799,10 @@ static bool
 handle_release_mousebinding(struct server *server,
                struct cursor_context *ctx, uint32_t button)
 {
+       if (server->osd_state.cycle_view) {
+               return false;
+       }
+
        struct mousebind *mousebind;
        bool consumed_by_frame_context = false;
 
@@ -884,6 +889,10 @@ static bool
 handle_press_mousebinding(struct server *server, struct cursor_context *ctx,
                uint32_t button, uint32_t resize_edges)
 {
+       if (server->osd_state.cycle_view) {
+               return false;
+       }
+
        struct mousebind *mousebind;
        bool double_click = is_double_click(rc.doubleclick_time, button, ctx);
        bool consumed_by_frame_context = false;
index 78c549b025f2babbaf194bf39fe4f3a915a4b23d..488f67fd257c02f8810c33ca736fa27de09c2325 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -725,6 +725,11 @@ xdg_activation_handle_request(struct wl_listener *listener, void *data)
                return;
        }
 
+       if (view->server->osd_state.cycle_view) {
+               wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
+               return;
+       }
+
        wlr_log(WLR_DEBUG, "Activating surface");
        desktop_focus_view(view, /*raise*/ true);
 }
index d59e0fb767e615f307319d4eb6b3330bca06ed8a..eda5aad7a1a51ef4ec1914b66a0228fee68746f8 100644 (file)
@@ -409,6 +409,11 @@ handle_request_activate(struct wl_listener *listener, void *data)
                return;
        }
 
+       if (view->server->osd_state.cycle_view) {
+               wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
+               return;
+       }
+
        desktop_focus_view(view, /*raise*/ true);
 }