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

commitbff6ccc62b64bfadf52f991c51f04d920e287c1e
parent2718b6da54
authorIsaac Freund <[email protected]>
date2023-11-08 13:16
xdg-toplevel: ignore redundant move/resize requests

Such requests currently lead to an assertion failure.

I don't know what changed in nautilus 45.0 that caused it to start doing
this and I probably don't want to know.

 river/XdgToplevel.zig | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index 8952106..dd42a99 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -381,7 +381,10 @@ fn handleRequestMove(
     if (view.pending.fullscreen) return;
     if (!(view.pending.float or view.pending.output.?.layout == null)) return;
 
-    seat.cursor.startMove(view);
+    switch (seat.cursor.mode) {
+        .passthrough, .down => seat.cursor.startMove(view),
+        .move, .resize => {},
+    }
 }
 
 fn handleRequestResize(listener: *wl.Listener(*wlr.XdgToplevel.event.Resize), event: *wlr.XdgToplevel.event.Resize) void {
@@ -406,7 +409,10 @@ fn handleRequestResize(listener: *wl.Listener(*wlr.XdgToplevel.event.Resize), ev
     if (view.pending.fullscreen) return;
     if (!(view.pending.float or view.pending.output.?.layout == null)) return;
 
-    seat.cursor.startResize(view, event.edges);
+    switch (seat.cursor.mode) {
+        .passthrough, .down => seat.cursor.startResize(view, event.edges),
+        .move, .resize => {},
+    }
 }
 
 /// Called when the client sets / updates its title