server->menu_current should be cleared before calling actions_run() as
it may internally call menu_open_root(). Clearing it after actions_run()
leads to an inconsistent state where a menu is opened but
server->menu_current is NULL. It even lead to a segfault when the item
opening another menu is contained in a pipemenu, because
menu_open_root() calls destroy_pipemenu() when server->menu_current is
set, which makes accessing item->actions a UAF.
return false;
}
- /*
- * We close the menu here to provide a faster feedback to the user.
- * We do that without resetting the input state so src/cursor.c
- * can do its own clean up on the following RELEASE event.
- */
struct server *server = item->parent->server;
menu_close(server->menu_current);
+ server->menu_current = NULL;
seat_focus_override_end(&server->seat);
/*
&item->actions, NULL);
}
- server->menu_current = NULL;
destroy_pipemenus(server);
return true;
}