Skip to content

Commit bf44690

Browse files
Dudemanguyrpigott
authored andcommitted
view: update wlr_toplevel size on client resizes
If a floating client resizes itself, sway updates several of its internal dimensions to match but not wlr_toplevel. This means that the next time wlroots sends a toplevel configure event, it can have wrong coordinates that resize the client back to its old size. To fix this, let's just use wlr_xdg_toplevel_set_size so the wlr_toplevel has the same dimensions as sway. Fixes swaywm#5266.
1 parent 4a22105 commit bf44690

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sway/tree/view.c

+5
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,11 @@ void view_update_size(struct sway_view *view) {
931931
con->pending.content_width = view->geometry.width;
932932
con->pending.content_height = view->geometry.height;
933933
container_set_geometry_from_content(con);
934+
935+
// Update the next scheduled width/height so correct coordinates
936+
// are sent on the next toplevel configure from wlroots.
937+
wlr_xdg_toplevel_set_size(view->wlr_xdg_toplevel, view->geometry.width,
938+
view->geometry.height);
934939
}
935940

936941
void view_center_surface(struct sway_view *view) {

0 commit comments

Comments
 (0)