mirror of
https://github.com/labwc/labwc.git
synced 2026-02-22 01:40:25 -05:00
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}.
This commit is contained in:
parent
23a9df0f30
commit
9f2eae672c
2 changed files with 10 additions and 5 deletions
|
|
@ -26,7 +26,11 @@ enum ssd_part_type {
|
||||||
LAB_SSD_BUTTON_ICONIFY,
|
LAB_SSD_BUTTON_ICONIFY,
|
||||||
LAB_SSD_BUTTON_WINDOW_MENU,
|
LAB_SSD_BUTTON_WINDOW_MENU,
|
||||||
LAB_SSD_PART_TITLEBAR,
|
LAB_SSD_PART_TITLEBAR,
|
||||||
|
LAB_SSD_PART_TITLEBAR_CORNER_RIGHT,
|
||||||
|
LAB_SSD_PART_TITLEBAR_CORNER_LEFT,
|
||||||
LAB_SSD_PART_TITLE,
|
LAB_SSD_PART_TITLE,
|
||||||
|
|
||||||
|
/* shared by shadows, borders and extents */
|
||||||
LAB_SSD_PART_CORNER_TOP_LEFT,
|
LAB_SSD_PART_CORNER_TOP_LEFT,
|
||||||
LAB_SSD_PART_CORNER_TOP_RIGHT,
|
LAB_SSD_PART_CORNER_TOP_RIGHT,
|
||||||
LAB_SSD_PART_CORNER_BOTTOM_RIGHT,
|
LAB_SSD_PART_CORNER_BOTTOM_RIGHT,
|
||||||
|
|
@ -35,6 +39,7 @@ enum ssd_part_type {
|
||||||
LAB_SSD_PART_RIGHT,
|
LAB_SSD_PART_RIGHT,
|
||||||
LAB_SSD_PART_BOTTOM,
|
LAB_SSD_PART_BOTTOM,
|
||||||
LAB_SSD_PART_LEFT,
|
LAB_SSD_PART_LEFT,
|
||||||
|
|
||||||
LAB_SSD_CLIENT,
|
LAB_SSD_CLIENT,
|
||||||
LAB_SSD_FRAME,
|
LAB_SSD_FRAME,
|
||||||
LAB_SSD_ROOT,
|
LAB_SSD_ROOT,
|
||||||
|
|
|
||||||
|
|
@ -115,9 +115,9 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
add_scene_rect(&subtree->parts, LAB_SSD_PART_TITLEBAR, parent,
|
add_scene_rect(&subtree->parts, LAB_SSD_PART_TITLEBAR, parent,
|
||||||
width - theme->window_button_width * 2, theme->title_height,
|
width - theme->window_button_width * 2, theme->title_height,
|
||||||
theme->window_button_width, 0, color);
|
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);
|
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,
|
corner_top_right, width - theme->window_button_width,
|
||||||
-rc.theme->border_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_set_size(
|
||||||
wlr_scene_rect_from_node(part->node), width - 2 * x, theme->title_height);
|
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);
|
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);
|
wlr_scene_node_set_enabled(part->node, !enable);
|
||||||
} FOR_EACH_END
|
} FOR_EACH_END
|
||||||
}
|
}
|
||||||
|
|
@ -246,7 +246,7 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
}
|
}
|
||||||
|
|
||||||
x = width - theme->window_button_width;
|
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);
|
wlr_scene_node_set_position(part->node, x, -rc.theme->border_width);
|
||||||
wl_list_for_each_reverse(b, &rc.title_buttons_right, link) {
|
wl_list_for_each_reverse(b, &rc.title_buttons_right, link) {
|
||||||
part = ssd_get_part(&subtree->parts, b->type);
|
part = ssd_get_part(&subtree->parts, b->type);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue