git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit93ff56e4c022e149726c157cd177e279ae3c8155
parent05f3db1d6f
authorIsaac Freund <[email protected]>
date2021-10-30 12:54
View: fix checks to respect client side move/resize

 river/XdgToplevel.zig          | 6 +++---
 river/command/move.zig         | 2 +-
 river/command/toggle_float.zig | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index 79eaff7..fc8c38e 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -311,7 +311,7 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) voi
         view.surface_box = new_box;
         // If the client has decided to resize itself and the view is floating,
         // then respect that resize.
-        if (view.pending.float and size_changed) {
+        if ((self.view.pending.float or self.view.output.pending.layout == null) and size_changed) {
             view.pending.box.width = new_box.width;
             view.pending.box.height = new_box.height;
             view.applyPending();
@@ -348,7 +348,7 @@ fn handleRequestMove(
 ) void {
     const self = @fieldParentPtr(Self, "request_move", listener);
     const seat = @intToPtr(*Seat, event.seat.seat.data);
-    if ((self.view.pending.float or self.view.output.current.layout == null) and !self.view.pending.fullscreen)
+    if ((self.view.pending.float or self.view.output.pending.layout == null) and !self.view.pending.fullscreen)
         seat.cursor.enterMode(.move, self.view);
 }
 
@@ -356,7 +356,7 @@ fn handleRequestMove(
 fn handleRequestResize(listener: *wl.Listener(*wlr.XdgToplevel.event.Resize), event: *wlr.XdgToplevel.event.Resize) void {
     const self = @fieldParentPtr(Self, "request_resize", listener);
     const seat = @intToPtr(*Seat, event.seat.seat.data);
-    if ((self.view.pending.float or self.view.output.current.layout == null) and !self.view.pending.fullscreen)
+    if ((self.view.pending.float or self.view.output.pending.layout == null) and !self.view.pending.fullscreen)
         seat.cursor.enterMode(.resize, self.view);
 }
 
diff --git a/river/command/move.zig b/river/command/move.zig
index 4df0977..e531bfc 100644
--- a/river/command/move.zig
+++ b/river/command/move.zig
@@ -140,7 +140,7 @@ fn apply(view: *View) void {
     // dimensions are set by a layout client. If however the views are
     // unarranged, leave them as non-floating so the next active layout can
     // affect them.
-    if (view.output.current.layout != null)
+    if (view.output.pending.layout != null)
         view.pending.float = true;
 
     view.float_box = view.pending.box;
diff --git a/river/command/toggle_float.zig b/river/command/toggle_float.zig
index 5f33c68..6b36374 100644
--- a/river/command/toggle_float.zig
+++ b/river/command/toggle_float.zig
@@ -38,7 +38,7 @@ pub fn toggleFloat(
         // If views are unarranged, don't allow changing the views float status.
         // It would just lead to confusing because this state would not be
         // visible immediately, only after a layout is connected.
-        if (view.output.current.layout == null)
+        if (view.output.pending.layout == null)
             return;
 
         // Don't float fullscreen views