mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
Convert menu to node_descriptors
This commit is contained in:
parent
eb7645d0e0
commit
8444ba4075
6 changed files with 75 additions and 68 deletions
|
|
@ -284,9 +284,9 @@ desktop_node_and_view_at(struct server *server, double lx, double ly,
|
|||
#endif
|
||||
}
|
||||
struct wlr_scene_node *osd = &server->osd_tree->node;
|
||||
struct wlr_scene_node *menu = &server->menu_tree->node;
|
||||
while (node) {
|
||||
struct node_descriptor *desc = node->data;
|
||||
/* TODO: convert to switch() */
|
||||
if (desc) {
|
||||
if (desc->type == LAB_NODE_DESC_VIEW) {
|
||||
goto has_view_data;
|
||||
|
|
@ -299,13 +299,16 @@ desktop_node_and_view_at(struct server *server, double lx, double ly,
|
|||
*view_area = LAB_SSD_CLIENT;
|
||||
return NULL;
|
||||
}
|
||||
if (desc->type == LAB_NODE_DESC_MENUITEM) {
|
||||
/* Always return the top scene node for menu items */
|
||||
*scene_node = node;
|
||||
*view_area = LAB_SSD_MENU;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (node == osd) {
|
||||
*view_area = LAB_SSD_OSD;
|
||||
return NULL;
|
||||
} else if (node == menu) {
|
||||
*view_area = LAB_SSD_MENU;
|
||||
return NULL;
|
||||
}
|
||||
node = node->parent;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue