diff options
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index a60de97f..f3f5cb82 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -137,11 +137,12 @@ impl TabletSeatHandler for State { delegate_tablet_manager!(State); impl PointerConstraintsHandler for State { - fn new_constraint(&mut self, _surface: &WlSurface, pointer: &PointerHandle<Self>) { - self.niri.maybe_activate_pointer_constraint( - pointer.current_location(), - &self.niri.pointer_contents, - ); + fn new_constraint(&mut self, _surface: &WlSurface, _pointer: &PointerHandle<Self>) { + // Pointer constraints track pointer focus internally, so make sure it's up to date before + // activating a new one. + self.refresh_pointer_contents(); + + self.niri.maybe_activate_pointer_constraint(); } fn cursor_position_hint( |
