Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sway/desktop/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,10 @@ static void arrange_container(struct sway_container *con,
int border_left = con->current.border_left ? border_width : 0;
int border_right = con->current.border_right ? border_width : 0;
int vert_border_height = MAX(0, height - border_top - border_bottom);
int horiz_border_width = MAX(0, width);

wlr_scene_rect_set_size(con->border.top, width, border_top);
wlr_scene_rect_set_size(con->border.bottom, width, border_bottom);
wlr_scene_rect_set_size(con->border.top, horiz_border_width, border_top);
wlr_scene_rect_set_size(con->border.bottom, horiz_border_width, border_bottom);
wlr_scene_rect_set_size(con->border.left,
border_left, vert_border_height);
wlr_scene_rect_set_size(con->border.right,
Expand All @@ -449,7 +450,7 @@ static void arrange_container(struct sway_container *con,
wlr_scene_node_set_position(&con->border.left->node,
0, border_top);
wlr_scene_node_set_position(&con->border.right->node,
width - border_right, border_top);
horiz_border_width - border_right, border_top);

// make sure to reparent, it's possible that the client just came out of
// fullscreen mode where the parent of the surface is not the container
Expand Down
12 changes: 12 additions & 0 deletions sway/input/seatop_move_tiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ static void resize_box(struct wlr_box *box, enum wlr_edges edge,
box->y += thickness;
box->width -= thickness * 2;
box->height -= thickness * 2;
if (box->width < 0) {
box->width = 0;
}
if (box->height < 0) {
box->height = 0;
}
break;
}
}
Expand Down Expand Up @@ -153,6 +159,12 @@ static bool split_titlebar(struct sway_node *node, struct sway_container *avoid,
}

static void update_indicator(struct seatop_move_tiling_event *e, struct wlr_box *box) {
if (box->width < 0) {
box->width = 0;
}
if (box->height < 0) {
box->height = 0;
}
wlr_scene_node_set_position(&e->indicator_rect->node, box->x, box->y);
wlr_scene_rect_set_size(e->indicator_rect, box->width, box->height);
}
Expand Down
10 changes: 9 additions & 1 deletion sway/tree/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,15 @@ static void update_rect_list(struct wlr_scene_tree *tree, pixman_region32_t *reg
if (i < len) {
const pixman_box32_t *box = &rects[i++];
wlr_scene_node_set_position(&rect->node, box->x1, box->y1);
wlr_scene_rect_set_size(rect, box->x2 - box->x1, box->y2 - box->y1);
int rect_width = box->x2 - box->x1;
int rect_height = box->y2 - box->y1;
if (rect_width < 0) {
rect_width = 0;
}
if (rect_height < 0) {
rect_height = 0;
}
wlr_scene_rect_set_size(rect, rect_width, rect_height);
}
}
}
Expand Down