src/ssd: Convert button node descriptors to struct ssd_button

This allows for way easier button hover detection and future
features like toggling rounded corner buttons on maximize.
This commit is contained in:
Consolatis 2022-06-08 19:51:02 +02:00 committed by Johan Malm
parent f1ada7e407
commit ca9226a7a6
8 changed files with 103 additions and 74 deletions

View file

@ -296,8 +296,10 @@ desktop_node_and_view_at(struct server *server, double lx, double ly,
}
if (desc->type == LAB_NODE_DESC_SSD_BUTTON) {
/* Always return the top scene node for SSD buttons */
struct ssd_button *button = node_ssd_button_from_node(node);
*scene_node = node;
goto has_view_data;
*view_area = button->type;
return button->view;
}
if (desc->type == LAB_NODE_DESC_LAYER_SURFACE) {
/* FIXME: we shouldn't have to set *view_area */