menu: support pipe menus

See labwc-menu(5) for usage.

Co-authored-by: @Consolatis
This commit is contained in:
Johan Malm 2023-10-31 21:36:45 +00:00 committed by Johan Malm
parent e5488fefcb
commit f3b68b8fb5
3 changed files with 506 additions and 65 deletions

View file

@ -29,6 +29,8 @@ struct menu_scene {
struct menuitem {
struct wl_list actions;
char *execute;
char *id; /* needed for pipemenus */
struct menu *parent;
struct menu *submenu;
bool selectable;
@ -46,6 +48,7 @@ struct menu {
char *label;
int item_height;
struct menu *parent;
struct {
int width;
int height;
@ -57,6 +60,8 @@ struct menu {
struct menuitem *item;
} selection;
struct wlr_scene_tree *scene_tree;
bool is_pipemenu;
enum menu_align align;
/* Used to match a window-menu to the view that triggered it. */
struct view *triggered_by_view; /* may be NULL */