mirror of
https://github.com/labwc/labwc.git
synced 2026-02-11 04:27:51 -05:00
menu: lazily generate menu scenes
This removes the need to call update_client_list_combined_menu()
and update_client_send_to_menu() every time a root menu is opened.
This commit also fixed the incorrect menu position with following
configuration:
<menu id="foo" label="foo">
<item label="aaaaaa"/>
<item label="bbbbbb"/>
</menu>
<menu id="root-menu">
<menu id="foo" />
<menu id="foo" />
</menu>
This commit is contained in:
parent
514f1d4fc4
commit
12f95543f0
3 changed files with 50 additions and 85 deletions
10
src/action.c
10
src/action.c
|
|
@ -664,16 +664,6 @@ show_menu(struct server *server, struct view *view, struct cursor_context *ctx,
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* We always refresh client-list-combined-menu and client-send-to-menu
|
||||
* so that they are up-to-date whether they are directly opened as a
|
||||
* top-level menu or opened as a submenu which we don't know at this
|
||||
* point. It is also needed to calculate the proper width for placement
|
||||
* as it fluctuates depending on application/workspace titles.
|
||||
*/
|
||||
update_client_list_combined_menu(menu->server);
|
||||
update_client_send_to_menu(menu->server);
|
||||
|
||||
int x = server->seat.cursor->x;
|
||||
int y = server->seat.cursor->y;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue