diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2021-07-29 13:42:36 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-07-29 13:42:36 +0200 |
| commit | bae826ef0e4b43b6e5f7b85ed910b71fa0b7544a (patch) | |
| tree | 0bf8ad4df39512d783d6e39ff50527e005bb055c | |
| parent | f56c89295800af0f043342af82febf64a70a1208 (diff) | |
| download | river-bae826ef0e4b43b6e5f7b85ed910b71fa0b7544a.tar.gz river-bae826ef0e4b43b6e5f7b85ed910b71fa0b7544a.tar.xz | |
cursor: fix crash if focus-follows-cursor is set
Currently we hit a stack overflow as we do not check if the target view
already has keyboard focus before calling Seat.focus() in
Cursor.passthrough(). To fix this, simply add this check.
| -rw-r--r-- | river/Cursor.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/river/Cursor.zig b/river/Cursor.zig index 06fd452..0fca04a 100644 --- a/river/Cursor.zig +++ b/river/Cursor.zig @@ -826,9 +826,11 @@ fn passthrough(self: *Self, time: u32) void { if (follow_mode == .strict or (follow_mode == .normal and focus_change)) { switch (result.parent) { .view => |view| { - self.seat.focusOutput(view.output); - self.seat.focus(view); - server.root.startTransaction(); + if (self.seat.focused != .view or self.seat.focused.view != view) { + self.seat.focusOutput(view.output); + self.seat.focus(view); + server.root.startTransaction(); + } }, .layer_surface => {}, } |
