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.
This commit is contained in:
Väinö Mäkelä 2023-05-08 20:36:21 +03:00 committed by Isaac Freund
parent 5de9bf846b
commit 792d94253c
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -139,6 +139,11 @@ pub fn configure(self: *Self) bool {
_ = self.xdg_toplevel.setResizing(inflight.resizing); _ = 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. // Only track configures with the transaction system if they affect the dimensions of the view.
if (inflight.box.width == current.box.width and if (inflight.box.width == current.box.width and
inflight.box.height == current.box.height) inflight.box.height == current.box.height)
@ -147,7 +152,7 @@ pub fn configure(self: *Self) bool {
} }
self.configure_state = .{ self.configure_state = .{
.inflight = self.xdg_toplevel.setSize(inflight.box.width, inflight.box.height), .inflight = configure_serial,
}; };
return true; return true;