View: only send configures through transactions

This reduces the number of separate configure events sent to clients
through better batching and is also more correct.
This commit is contained in:
Isaac Freund
2023-03-01 20:44:13 +01:00
parent ed0aa73670
commit 83fe764fcd
7 changed files with 39 additions and 82 deletions

View File

@ -122,17 +122,14 @@ fn csdFilterUpdateViews(kind: FilterKind, pattern: []const u8, operation: enum {
const view = @intToPtr(*View, xdg_toplevel_decoration.surface.data);
if (viewMatchesPattern(kind, pattern, view)) {
const toplevel = view.impl.xdg_toplevel.xdg_toplevel;
switch (operation) {
.add => {
_ = xdg_toplevel_decoration.setMode(.client_side);
view.pending.borders = false;
_ = toplevel.setTiled(.{ .top = false, .bottom = false, .left = false, .right = false });
},
.remove => {
_ = xdg_toplevel_decoration.setMode(.server_side);
view.pending.borders = true;
_ = toplevel.setTiled(.{ .top = true, .bottom = true, .left = true, .right = true });
},
}
}