Cursor: lock to current geometry during move/resize

This eliminates cursor jitter entirely during interactive resize.

This also fixes a bug where the xdg-toplevel resizing state was not
cleared if a resize operation was aborted due to a change in view tags
or similar.
This commit is contained in:
Isaac Freund
2023-03-14 12:43:59 +01:00
parent 9db41115a8
commit a679743fa0
2 changed files with 47 additions and 50 deletions

View File

@ -493,6 +493,28 @@ pub fn applyPending(root: *Self) void {
}
}
{
var it = server.input_manager.seats.first;
while (it) |node| : (it = node.next) {
const cursor = &node.data.cursor;
switch (cursor.mode) {
.passthrough, .down => {},
inline .move, .resize => |data| {
if (data.view.inflight.output == null or
data.view.inflight.tags & data.view.inflight.output.?.inflight.tags == 0 or
(!data.view.inflight.float and data.view.inflight.output.?.layout != null) or
data.view.inflight.fullscreen)
{
cursor.mode = .passthrough;
data.view.pending.resizing = false;
data.view.inflight.resizing = false;
}
},
}
}
}
if (root.inflight_layout_demands == 0) {
root.sendConfigures();
}