ssd: update comments referencing ssd_part/ssd_part_type

This commit is contained in:
John Lindgren 2025-09-06 14:04:21 -04:00
parent f129571779
commit d14f5ca228
3 changed files with 18 additions and 19 deletions

View file

@ -41,25 +41,25 @@ struct cursor_context {
*
* Behavior if node points to a surface:
* - If surface is a layer-surface, type will be
* set to LAB_SSD_LAYER_SURFACE and view will be NULL.
* set to LAB_NODE_LAYER_SURFACE and view will be NULL.
*
* - If surface is a 'lost' unmanaged xsurface (one
* with a never-mapped parent view), type will
* be set to LAB_SSD_UNMANAGED and view will be NULL.
* be set to LAB_NODE_UNMANAGED and view will be NULL.
*
* 'Lost' unmanaged xsurfaces are usually caused by
* X11 applications opening popups without setting
* the main window as parent. Example: VLC submenus.
*
* - Any other surface will cause type to be set to
* LAB_SSD_CLIENT and return the attached view.
* LAB_NODE_CLIENT and return the attached view.
*
* Behavior if node points to internal elements:
* - type will be set to the appropriate enum value
* and view will be NULL if the node is not part of the SSD.
*
* If no node is found for the given layout coordinates,
* type will be set to LAB_SSD_ROOT and view will be NULL.
* type will be set to LAB_NODE_ROOT and view will be NULL.
*
*/
struct cursor_context get_cursor_context(struct server *server);

View file

@ -13,21 +13,22 @@ struct ssd_state_title_width {
};
/*
* The scene-graph of SSD looks like below. The parentheses indicate the type of
* ssd_part attached to the node.
* The scene-graph of SSD looks like below. The parentheses indicate the
* type of each node (enum lab_node_type, stored in the node_descriptor
* attached to the wlr_scene_node).
*
* ssd->tree (LAB_SSD_NONE)
* +--titlebar (LAB_SSD_PART_TITLEBAR)
* ssd->tree (LAB_NODE_NONE)
* +--titlebar (LAB_NODE_TITLEBAR)
* | +--inactive
* | | +--background bar
* | | +--left corner
* | | +--right corner
* | | +--title (LAB_SSD_PART_TITLE)
* | | +--iconify button (LAB_SSD_BUTTON_ICONIFY)
* | | +--title (LAB_NODE_TITLE)
* | | +--iconify button (LAB_NODE_BUTTON_ICONIFY)
* | | | +--normal close icon image
* | | | +--hovered close icon image
* | | | +--...
* | | +--window icon (LAB_SSD_BUTTON_WINDOW_ICON)
* | | +--window icon (LAB_NODE_BUTTON_WINDOW_ICON)
* | | | +--window icon image
* | | +--...
* | +--active
@ -103,9 +104,8 @@ struct ssd {
struct wlr_scene_buffer *corner_right;
struct wlr_scene_buffer *bar;
struct scaled_font_buffer *title;
/* List of ssd_parts that represent buttons */
struct wl_list buttons_left;
struct wl_list buttons_right;
struct wl_list buttons_left; /* ssd_button.link */
struct wl_list buttons_right; /* ssd_button.link */
} subtrees[2]; /* indexed by enum ssd_active_state */
} titlebar;
@ -149,9 +149,8 @@ struct ssd_button {
* img_buffers[state_set] is displayed. Some of these can be NULL
* (e.g. img_buffers[LAB_BS_ROUNDED] is set only for corner buttons).
*
* When the type of ssd_part pointing to ssd_button is
* LAB_SSD_BUTTON_WINDOW_ICON, these are all NULL and window_icon is
* used instead.
* When the button type is LAB_NODE_BUTTON_WINDOW_ICON,
* these are all NULL and window_icon is used instead.
*/
struct scaled_img_buffer *img_buffers[LAB_BS_ALL + 1];

View file

@ -104,9 +104,9 @@ struct theme {
* The texture of a window buttons for each hover/toggled/rounded
* state. This can be accessed like:
*
* buttons[LAB_SSD_BUTTON_ICONIFY][LAB_BS_HOVERED | LAB_BS_TOGGLED]
* buttons[LAB_NODE_BUTTON_ICONIFY][LAB_BS_HOVERED | LAB_BS_TOGGLED]
*
* Elements in buttons[0] are all NULL since LAB_SSD_BUTTON_FIRST is 1.
* Elements in buttons[0] are all NULL since LAB_NODE_BUTTON_FIRST is 1.
*/
struct lab_img *button_imgs
[LAB_NODE_BUTTON_LAST + 1][LAB_BS_ALL + 1];