aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVäinö Mäkelä <vaino.o.makela@gmail.com>2023-05-08 20:36:21 +0300
committerIsaac Freund <mail@isaacfreund.com>2023-05-11 23:02:34 +0200
commit792d94253c191e653e4025a648d574d9f8ce99bf (patch)
tree15efde6a79c2134b81d2ba3c23066347b0ac5ad4
parent5de9bf846b27af2c001a780a0d524e8fba7637a2 (diff)
downloadriver-792d94253c191e653e4025a648d574d9f8ce99bf.tar.gz
river-792d94253c191e653e4025a648d574d9f8ce99bf.tar.xz
XdgToplevel: keep wlroots updated on view sizes
When sending a configure, wlroots will send the same size that was sent on the previous configure unless a new size is set. If a client resizes their window itself, the size wlroots has in XdgToplevel.scheduled will be obsolete and needs to be updated by river.
-rw-r--r--river/XdgToplevel.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index bcb7bb6..0b5296c 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -139,6 +139,11 @@ pub fn configure(self: *Self) bool {
_ = self.xdg_toplevel.setResizing(inflight.resizing);
+ // We need to call this wlroots function even if the inflight dimensions
+ // match the current dimensions in order to prevent wlroots internal state
+ // from getting out of sync in the case where a client has resized itself.
+ const configure_serial = self.xdg_toplevel.setSize(inflight.box.width, inflight.box.height);
+
// Only track configures with the transaction system if they affect the dimensions of the view.
if (inflight.box.width == current.box.width and
inflight.box.height == current.box.height)
@@ -147,7 +152,7 @@ pub fn configure(self: *Self) bool {
}
self.configure_state = .{
- .inflight = self.xdg_toplevel.setSize(inflight.box.width, inflight.box.height),
+ .inflight = configure_serial,
};
return true;