mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 09:21:28 +00:00
tree/container: ensure pixman rect is valid in container_arrange_title_bar()
Fixes "Invalid rectangle passed" errors printed by Pixman.
This commit is contained in:
parent
b463957021
commit
30f5c3a911
|
@ -352,6 +352,8 @@ void container_arrange_title_bar(struct sway_container *con) {
|
||||||
|
|
||||||
int alloc_width = MIN((int)node->width,
|
int alloc_width = MIN((int)node->width,
|
||||||
width - h_padding - config->titlebar_h_padding);
|
width - h_padding - config->titlebar_h_padding);
|
||||||
|
alloc_width = MAX(alloc_width, 0);
|
||||||
|
|
||||||
sway_text_node_set_max_width(node, alloc_width);
|
sway_text_node_set_max_width(node, alloc_width);
|
||||||
wlr_scene_node_set_position(node->node,
|
wlr_scene_node_set_position(node->node,
|
||||||
h_padding, (height - node->height) >> 1);
|
h_padding, (height - node->height) >> 1);
|
||||||
|
@ -376,6 +378,8 @@ void container_arrange_title_bar(struct sway_container *con) {
|
||||||
|
|
||||||
int alloc_width = MIN((int) node->width,
|
int alloc_width = MIN((int) node->width,
|
||||||
width - h_padding - config->titlebar_h_padding);
|
width - h_padding - config->titlebar_h_padding);
|
||||||
|
alloc_width = MAX(alloc_width, 0);
|
||||||
|
|
||||||
sway_text_node_set_max_width(node, alloc_width);
|
sway_text_node_set_max_width(node, alloc_width);
|
||||||
wlr_scene_node_set_position(node->node,
|
wlr_scene_node_set_position(node->node,
|
||||||
h_padding, (height - node->height) >> 1);
|
h_padding, (height - node->height) >> 1);
|
||||||
|
|
Loading…
Reference in a new issue