Don't open menu or start window switching while other server interaction

This should make the transition of the server state more predictable and
prevent potential bugs.
This commit is contained in:
tokyo4j 2024-12-28 17:03:26 +09:00 committed by Johan Malm
parent 5d3ce3e190
commit 66a3beb98b
2 changed files with 8 additions and 0 deletions

View 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 =

View 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);