]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Don't open menu or start window switching while other server interaction
authortokyo4j <hrak1529@gmail.com>
Sat, 28 Dec 2024 08:03:26 +0000 (17:03 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 28 Dec 2024 21:28:22 +0000 (21:28 +0000)
This should make the transition of the server state more predictable and
prevent potential bugs.

src/action.c
src/menu/menu.c

index 9396a4b1a993f84e4b91380bb971bafbcbd0d204..b95dd9df5a63fdc07b0448c1c84b98919ab07172 100644 (file)
@@ -800,6 +800,10 @@ shift_is_pressed(struct server *server)
 static void
 start_window_cycling(struct server *server, enum lab_cycle_dir direction)
 {
+       if (server->input_mode != LAB_INPUT_STATE_PASSTHROUGH) {
+               return;
+       }
+
        /* Remember direction so it can be followed by subsequent key presses */
        server->osd_state.initial_direction = direction;
        server->osd_state.initial_keybind_contained_shift =
index 6a0f5ce83c8605dccb8998828b683ed396de37bf..91a401780bd659d10a9972cbe9632ae1ee6c2bba 100644 (file)
@@ -1322,6 +1322,10 @@ menu_close(struct menu *menu)
 void
 menu_open_root(struct menu *menu, int x, int y)
 {
+       if (menu->server->input_mode != LAB_INPUT_STATE_PASSTHROUGH) {
+               return;
+       }
+
        assert(menu);
        if (menu->server->menu_current) {
                menu_close(menu->server->menu_current);