aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2023-03-06 20:43:40 +0100
committerIsaac Freund <mail@isaacfreund.com>2023-03-10 10:48:54 +0100
commitfc6d1cca15f39755e00b2c89501ef3975f63e562 (patch)
tree91fb57da6c4976ab9a4bedbfbb570c89c35c262d
parent0752b6b9ba7e812fa6d8f080cc8ff8ac21d61fff (diff)
downloadriver-fc6d1cca15f39755e00b2c89501ef3975f63e562.tar.gz
river-fc6d1cca15f39755e00b2c89501ef3975f63e562.tar.xz
xdg-shell: determine tiled state by float state
How river currently sets this isn't really in accordance with the spirit of the protocol. It was originally done this way to get gtk3 windows to look a little bit better with borders drawn around them. However, I've come to believe that river shouldn't just ignore standards like this. The right way to do things would be to either implement the xdg-decoration protocol for gtk properly or to be pragmatic and accept some programs are intended to be used with CSD and that's OK.
-rw-r--r--river/XdgToplevel.zig20
1 files changed, 12 insertions, 8 deletions
diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index d5e84f9..1a9b983 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -98,15 +98,20 @@ pub fn configure(self: *Self) bool {
const inflight = &self.view.inflight;
const current = &self.view.current;
+ const inflight_fullscreen = inflight.output != null and inflight.output.?.inflight.fullscreen == self.view;
+ const current_fullscreen = current.output != null and current.output.?.current.fullscreen == self.view;
+
+ const inflight_float = inflight.float or (inflight.output != null and inflight.output.?.layout == null);
+ const current_float = current.float or (current.output != null and current.output.?.layout == null);
+
// We avoid a special case for newly mapped views which we have not yet
// configured by setting the current width/height to the initial width/height
// of the view in handleMap().
if (inflight.box.width == current.box.width and
inflight.box.height == current.box.height and
(inflight.focus != 0) == (current.focus != 0) and
- (inflight.output != null and inflight.output.?.inflight.fullscreen == self.view) ==
- (current.output != null and current.output.?.current.fullscreen == self.view) and
- inflight.borders == current.borders and
+ inflight_fullscreen == current_fullscreen and
+ inflight_float == current_float and
inflight.resizing == current.resizing)
{
return false;
@@ -114,13 +119,12 @@ pub fn configure(self: *Self) bool {
_ = self.xdg_toplevel.setActivated(inflight.focus != 0);
- const fullscreen = inflight.output != null and inflight.output.?.inflight.fullscreen == self.view;
- _ = self.xdg_toplevel.setFullscreen(fullscreen);
+ _ = self.xdg_toplevel.setFullscreen(inflight_fullscreen);
- if (inflight.borders) {
- _ = self.xdg_toplevel.setTiled(.{ .top = true, .bottom = true, .left = true, .right = true });
- } else {
+ if (inflight_float) {
_ = self.xdg_toplevel.setTiled(.{ .top = false, .bottom = false, .left = false, .right = false });
+ } else {
+ _ = self.xdg_toplevel.setTiled(.{ .top = true, .bottom = true, .left = true, .right = true });
}
_ = self.xdg_toplevel.setResizing(inflight.resizing);