diff options
author | 2023-07-15 22:44:10 -0500 | |
---|---|---|
committer | 2023-08-26 13:44:37 -0700 | |
commit | bf44690ee8ce8438ffb1a84fbe6e8dbb6a851c04 (patch) | |
tree | 558cb67e819842f5b311b005884738e3ddca69f5 | |
parent | Hide xwayland_shell_v1 from regular clients (diff) | |
download | sway-bf44690ee8ce8438ffb1a84fbe6e8dbb6a851c04.tar.gz sway-bf44690ee8ce8438ffb1a84fbe6e8dbb6a851c04.tar.zst sway-bf44690ee8ce8438ffb1a84fbe6e8dbb6a851c04.zip |
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 #5266.
-rw-r--r-- | sway/tree/view.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index ec54fed8..8cc94a05 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -931,6 +931,11 @@ void view_update_size(struct sway_view *view) { | |||
931 | con->pending.content_width = view->geometry.width; | 931 | con->pending.content_width = view->geometry.width; |
932 | con->pending.content_height = view->geometry.height; | 932 | con->pending.content_height = view->geometry.height; |
933 | container_set_geometry_from_content(con); | 933 | 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); | ||
934 | } | 939 | } |
935 | 940 | ||
936 | void view_center_surface(struct sway_view *view) { | 941 | void view_center_surface(struct sway_view *view) { |