XdgToplevel: work around buggy clients
Unfortunately, clients in the wild sometimes get the configure/ack_configure/commit sequence wrong, committing the configured surface with a size different than the one they ack'd only to later in separate commit adpat the surface size to that requested by the compositor. Improve river's handling of such buggy clients to keep river's ssd borders and internal state consistent with whatever the clients actually commit regardless of the correctness of the clients. Log a shame message for such clients to make me feel better about working around their bugs.
This commit is contained in:
parent
9b2d99fa79
commit
95da9b5875
@ -324,10 +324,6 @@ pub fn commitTransaction(view: *Self) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn updateCurrent(view: *Self) void {
|
pub fn updateCurrent(view: *Self) void {
|
||||||
// Applied already in View.commitTransaction()
|
|
||||||
assert(view.current.tags == view.inflight.tags);
|
|
||||||
assert(view.current.output == view.inflight.output);
|
|
||||||
|
|
||||||
view.current = view.inflight;
|
view.current = view.inflight;
|
||||||
|
|
||||||
const box = &view.current.box;
|
const box = &view.current.box;
|
||||||
|
@ -348,19 +348,28 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), _: *wlr.Surface) void {
|
|||||||
const no_layout = view.current.output != null and view.current.output.?.layout == null;
|
const no_layout = view.current.output != null and view.current.output.?.layout == null;
|
||||||
|
|
||||||
if (size_changed) {
|
if (size_changed) {
|
||||||
log.info(
|
log.debug(
|
||||||
"client initiated size change: {}x{} -> {}x{}",
|
"client initiated size change: {}x{} -> {}x{}",
|
||||||
.{ old_geometry.width, old_geometry.height, self.geometry.width, self.geometry.height },
|
.{ old_geometry.width, old_geometry.height, self.geometry.width, self.geometry.height },
|
||||||
);
|
);
|
||||||
if ((view.current.float or no_layout) and !view.current.fullscreen) {
|
if (!(view.current.float or no_layout) and !view.current.fullscreen) {
|
||||||
view.current.box.width = self.geometry.width;
|
// It seems that a disappointingly high number of clients have a buggy
|
||||||
view.current.box.height = self.geometry.height;
|
// response to configure events. They ack the configure immediately but then
|
||||||
view.pending.box.width = self.geometry.width;
|
// proceed to make one or more wl_surface.commit requests with the old size
|
||||||
view.pending.box.height = self.geometry.height;
|
// before updating the size of the surface. This obviously makes river's
|
||||||
server.root.applyPending();
|
// efforts towards frame perfection futile for such clients. However, in the
|
||||||
} else {
|
// interest of best serving river's users we will fix up their size here after
|
||||||
log.err("client is buggy and initiated size change while tiled or fullscreen", .{});
|
// logging a shame message.
|
||||||
|
log.err("client with app-id '{s}' is buggy and initiated size change while tiled or fullscreen, shame on it", .{
|
||||||
|
view.getAppId() orelse "",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view.inflight.box.width = self.geometry.width;
|
||||||
|
view.inflight.box.height = self.geometry.height;
|
||||||
|
view.pending.box.width = self.geometry.width;
|
||||||
|
view.pending.box.height = self.geometry.height;
|
||||||
|
view.updateCurrent();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// If the client has not yet acked our configure, we need to send a
|
// If the client has not yet acked our configure, we need to send a
|
||||||
|
Loading…
Reference in New Issue
Block a user