From 9f2eae672ccd0b048717798e413951c729ffe6dd Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Fri, 23 Aug 2024 13:05:13 +0900 Subject: [PATCH] ssd: fix incorrect cursor shape on titlebar corner without buttons Before this commit, the backgrounds of titlebar corners were tagged as LAB_SSD_PART_CORNER_TOP_{LEFT,RIGHT}, so the cursor shape on titlebar corners without buttons were north-west or north-east. This commit fixes it by tagging those backgrounds as LAB_SSD_TITLEBAR_CORNER_{LEFT,RIGHT}. --- include/ssd.h | 5 +++++ src/ssd/ssd-titlebar.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/ssd.h b/include/ssd.h index 7a2e7a77..2924253c 100644 --- a/include/ssd.h +++ b/include/ssd.h @@ -26,7 +26,11 @@ enum ssd_part_type { LAB_SSD_BUTTON_ICONIFY, LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_PART_TITLEBAR, + LAB_SSD_PART_TITLEBAR_CORNER_RIGHT, + LAB_SSD_PART_TITLEBAR_CORNER_LEFT, LAB_SSD_PART_TITLE, + + /* shared by shadows, borders and extents */ LAB_SSD_PART_CORNER_TOP_LEFT, LAB_SSD_PART_CORNER_TOP_RIGHT, LAB_SSD_PART_CORNER_BOTTOM_RIGHT, @@ -35,6 +39,7 @@ enum ssd_part_type { LAB_SSD_PART_RIGHT, LAB_SSD_PART_BOTTOM, LAB_SSD_PART_LEFT, + LAB_SSD_CLIENT, LAB_SSD_FRAME, LAB_SSD_ROOT, diff --git a/src/ssd/ssd-titlebar.c b/src/ssd/ssd-titlebar.c index 292810bd..827269aa 100644 --- a/src/ssd/ssd-titlebar.c +++ b/src/ssd/ssd-titlebar.c @@ -115,9 +115,9 @@ ssd_titlebar_create(struct ssd *ssd) add_scene_rect(&subtree->parts, LAB_SSD_PART_TITLEBAR, parent, width - theme->window_button_width * 2, theme->title_height, theme->window_button_width, 0, color); - add_scene_buffer(&subtree->parts, LAB_SSD_PART_CORNER_TOP_LEFT, parent, + add_scene_buffer(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_LEFT, parent, corner_top_left, -rc.theme->border_width, -rc.theme->border_width); - add_scene_buffer(&subtree->parts, LAB_SSD_PART_CORNER_TOP_RIGHT, parent, + add_scene_buffer(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_RIGHT, parent, corner_top_right, width - theme->window_button_width, -rc.theme->border_width); @@ -167,10 +167,10 @@ set_squared_corners(struct ssd *ssd, bool enable) wlr_scene_rect_set_size( wlr_scene_rect_from_node(part->node), width - 2 * x, theme->title_height); - part = ssd_get_part(&subtree->parts, LAB_SSD_PART_CORNER_TOP_LEFT); + part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_LEFT); wlr_scene_node_set_enabled(part->node, !enable); - part = ssd_get_part(&subtree->parts, LAB_SSD_PART_CORNER_TOP_RIGHT); + part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_RIGHT); wlr_scene_node_set_enabled(part->node, !enable); } FOR_EACH_END } @@ -246,7 +246,7 @@ ssd_titlebar_update(struct ssd *ssd) } x = width - theme->window_button_width; - part = ssd_get_part(&subtree->parts, LAB_SSD_PART_CORNER_TOP_RIGHT); + part = ssd_get_part(&subtree->parts, LAB_SSD_PART_TITLEBAR_CORNER_RIGHT); wlr_scene_node_set_position(part->node, x, -rc.theme->border_width); wl_list_for_each_reverse(b, &rc.title_buttons_right, link) { part = ssd_get_part(&subtree->parts, b->type); -- 2.52.0