Skip to content

Commit

Permalink
tree/container: ensure pixman rect is valid in container_arrange_titl…
Browse files Browse the repository at this point in the history
…e_bar()

Fixes "Invalid rectangle passed" errors printed by Pixman.
  • Loading branch information
emersion committed May 7, 2024
1 parent b463957 commit 30f5c3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sway/tree/container.c
Expand Up @@ -352,6 +352,8 @@ void container_arrange_title_bar(struct sway_container *con) {

int alloc_width = MIN((int)node->width,
width - h_padding - config->titlebar_h_padding);
alloc_width = MAX(alloc_width, 0);

sway_text_node_set_max_width(node, alloc_width);
wlr_scene_node_set_position(node->node,
h_padding, (height - node->height) >> 1);
Expand All @@ -376,6 +378,8 @@ void container_arrange_title_bar(struct sway_container *con) {

int alloc_width = MIN((int) node->width,
width - h_padding - config->titlebar_h_padding);
alloc_width = MAX(alloc_width, 0);

sway_text_node_set_max_width(node, alloc_width);
wlr_scene_node_set_position(node->node,
h_padding, (height - node->height) >> 1);
Expand Down

0 comments on commit 30f5c3a

Please sign in to comment.