diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-03 09:32:58 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-03 10:15:19 +0300 |
| commit | 9193245871bf16e0e5b513806dc988caee994c13 (patch) | |
| tree | 62db8cce1b02016c6630900cf9428423ef28d75e /src/input | |
| parent | 7baf10b751697de0d17a4bac003e5f5207900bf2 (diff) | |
| download | niri-9193245871bf16e0e5b513806dc988caee994c13.tar.gz niri-9193245871bf16e0e5b513806dc988caee994c13.tar.bz2 niri-9193245871bf16e0e5b513806dc988caee994c13.zip | |
Correct pointer constraint activation logic
Internally it uses the pointer focus, so make sure we have up-to-date
focus before setting it.
Diffstat (limited to 'src/input')
| -rw-r--r-- | src/input/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/input/mod.rs b/src/input/mod.rs index 24d72bc0..888631e2 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1448,9 +1448,6 @@ impl State { self.niri.handle_focus_follows_mouse(&under); - // Activate a new confinement if necessary. - self.niri.maybe_activate_pointer_constraint(new_pos, &under); - self.niri.pointer_contents.clone_from(&under); pointer.motion( @@ -1475,6 +1472,9 @@ impl State { pointer.frame(self); + // Activate a new confinement if necessary. + self.niri.maybe_activate_pointer_constraint(); + // Redraw to update the cursor position. // FIXME: redraw only outputs overlapping the cursor. self.niri.queue_redraw_all(); @@ -1513,7 +1513,6 @@ impl State { self.niri.handle_focus_follows_mouse(&under); - self.niri.maybe_activate_pointer_constraint(pos, &under); self.niri.pointer_contents.clone_from(&under); pointer.motion( @@ -1528,6 +1527,8 @@ impl State { pointer.frame(self); + self.niri.maybe_activate_pointer_constraint(); + // We moved the pointer, show it. self.niri.pointer_hidden = false; |
