mirror of
https://github.com/labwc/labwc.git
synced 2026-06-13 14:33:18 -04:00
Fix bug where border would be drawn past the edge of tiny windows
This commit is contained in:
parent
ad05ea5897
commit
7f48b191c3
2 changed files with 19 additions and 13 deletions
|
|
@ -426,6 +426,10 @@ void renderBufferset(struct bufferset *bufferset, int width, int height, int y)
|
|||
|
||||
void renderBuffersetXY(struct bufferset *bufferset, int width, int height, int x, int y)
|
||||
{
|
||||
// Bail early if you're being asked to generate buffers with negative size
|
||||
if (width < 2 * bufferset->border_width || height < 2 * bufferset->border_width) {
|
||||
return;
|
||||
}
|
||||
wlr_scene_buffer_set_dest_size(bufferset->top,
|
||||
width - 2 * bufferset->border_width, bufferset->border_width);
|
||||
wlr_scene_node_set_position(&bufferset->top->node,
|
||||
|
|
|
|||
|
|
@ -371,9 +371,11 @@ ssd_titlebar_update(struct ssd *ssd)
|
|||
int button_count = 0;
|
||||
|
||||
wl_list_for_each(button, &subtree->buttons_left, link) {
|
||||
wlr_scene_node_set_position(button->node, x, y);
|
||||
x += theme->window_button_width + theme->window_button_spacing;
|
||||
button_count++;
|
||||
if (button->node->enabled) {
|
||||
wlr_scene_node_set_position(button->node, x, y);
|
||||
x += theme->window_button_width + theme->window_button_spacing;
|
||||
button_count++;
|
||||
}
|
||||
}
|
||||
int exclusive_x = x;
|
||||
|
||||
|
|
@ -383,9 +385,11 @@ ssd_titlebar_update(struct ssd *ssd)
|
|||
|
||||
x = width - theme->window_titlebar_padding_width + theme->window_button_spacing;
|
||||
wl_list_for_each(button, &subtree->buttons_right, link) {
|
||||
x -= theme->window_button_width + theme->window_button_spacing;
|
||||
wlr_scene_node_set_position(button->node, x, y);
|
||||
button_count++;
|
||||
if (button->node->enabled) {
|
||||
x -= theme->window_button_width + theme->window_button_spacing;
|
||||
wlr_scene_node_set_position(button->node, x, y);
|
||||
button_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (theme->window[active].title_bg.border_type) {
|
||||
|
|
@ -393,17 +397,15 @@ ssd_titlebar_update(struct ssd *ssd)
|
|||
int titlebar_width = MAX(view->current.width, 0);
|
||||
if (theme->window[active].title_bg.exclusive) {
|
||||
titlebar_x = exclusive_x+theme->window_titlebar_padding_width;
|
||||
titlebar_width = MAX(
|
||||
titlebar_width = titlebar_width -
|
||||
(theme->window_button_width + theme->window_button_spacing)
|
||||
* button_count,
|
||||
titlebar_width -
|
||||
(theme->window_button_width + theme->window_button_spacing)
|
||||
* button_count
|
||||
);
|
||||
* button_count;
|
||||
}
|
||||
|
||||
renderBuffersetXY(subtree->textured_borders, titlebar_width,
|
||||
if (titlebar_width > 0) {
|
||||
renderBuffersetXY(subtree->textured_borders, titlebar_width,
|
||||
theme->titlebar_height, titlebar_x, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue