]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ssd: fix incorrect cursor shape on titlebar corner without buttons
authortokyo4j <hrak1529@gmail.com>
Fri, 23 Aug 2024 04:05:13 +0000 (13:05 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 23 Aug 2024 18:34:03 +0000 (20:34 +0200)
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
src/ssd/ssd-titlebar.c

index 7a2e7a77e665bb9fbd3adb3dd4c7dfea856e8826..2924253ca9ea5e23cd83a7af245669095d459225 100644 (file)
@@ -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,
index 292810bdffca82b1cdf57f9c40e383a523961633..827269aa1f0473dd26b642a6f07d7ca3c780c49a 100644 (file)
@@ -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);