]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action: allow only Previous/NextWindow action while window switching
authortokyo4j <hrak1529@gmail.com>
Sun, 9 Mar 2025 16:56:09 +0000 (01:56 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 9 Mar 2025 20:41:26 +0000 (20:41 +0000)
This commit prevents some actions like SendToDesktop from being executed
while window switching, which may mess up our scene-graph.

src/action.c

index 3b03558c7367c02b7f94204d45bea6cd81094d01..6f99cc4602e4426f7b609a3ef097ad22274fbb49 100644 (file)
@@ -877,6 +877,14 @@ actions_run(struct view *activator, struct server *server,
        }
 
        wl_list_for_each(action, actions, link) {
+               if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER
+                               && action->type != ACTION_TYPE_NEXT_WINDOW
+                               && action->type != ACTION_TYPE_PREVIOUS_WINDOW) {
+                       wlr_log(WLR_INFO, "Only NextWindow or PreviousWindow "
+                               "actions are accepted while window switching.");
+                       continue;
+               }
+
                wlr_log(WLR_DEBUG, "Handling action %u: %s", action->type,
                        action_names[action->type]);