mirror of
https://github.com/labwc/labwc.git
synced 2026-06-17 14:33:30 -04:00
menu: fix pipemenu bug causing parent menu to disappear
...introduced by 7651531632
Only post-process the pipemenu instead of processing all menus because
post_processing() calls menu_update_scene() which is a bit heavier than
its predecessor and calls wlr_scene_node_set_enabled() which disables
existing menus.
This commit is contained in:
parent
d7e6f3a7a8
commit
e95bff7be0
1 changed files with 17 additions and 6 deletions
|
|
@ -367,6 +367,21 @@ menu_update_scene(struct menu *menu)
|
||||||
menu->size.height = item_y;
|
menu->size.height = item_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
post_processing_from(struct server *server, struct menu *from)
|
||||||
|
{
|
||||||
|
bool should_process = false;
|
||||||
|
struct menu *menu;
|
||||||
|
wl_list_for_each(menu, &server->menus, link) {
|
||||||
|
if (menu == from) {
|
||||||
|
should_process = true;
|
||||||
|
}
|
||||||
|
if (should_process) {
|
||||||
|
menu_update_scene(menu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
post_processing(struct server *server)
|
post_processing(struct server *server)
|
||||||
{
|
{
|
||||||
|
|
@ -1359,18 +1374,14 @@ create_pipe_menu(struct menu_pipe_context *ctx)
|
||||||
}
|
}
|
||||||
ctx->item->submenu = pipe_menu;
|
ctx->item->submenu = pipe_menu;
|
||||||
|
|
||||||
/*
|
|
||||||
* TODO: refactor validate() and post_processing() to only
|
|
||||||
* operate from current point onwards
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Set menu-widths before configuring */
|
/* Set menu-widths before configuring */
|
||||||
post_processing(ctx->server);
|
post_processing_from(ctx->server, pipe_menu);
|
||||||
|
|
||||||
enum menu_align align = ctx->item->parent->align;
|
enum menu_align align = ctx->item->parent->align;
|
||||||
struct wlr_box pos = get_submenu_position(ctx->item, align);
|
struct wlr_box pos = get_submenu_position(ctx->item, align);
|
||||||
menu_configure(pipe_menu, pos.x, pos.y, align);
|
menu_configure(pipe_menu, pos.x, pos.y, align);
|
||||||
|
|
||||||
|
/*TODO: refactor validate() to only operate from current point onwards */
|
||||||
validate(ctx->server);
|
validate(ctx->server);
|
||||||
|
|
||||||
/* Finally open the new submenu tree */
|
/* Finally open the new submenu tree */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue