diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-15 16:30:52 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-15 16:33:24 +0400 |
| commit | da59dfc5b4b6046475c36a377be661fbf3351bd0 (patch) | |
| tree | 57117aed9b34161210ae8dc2086c21741d405430 /src/input.rs | |
| parent | 67ea378ff724f0a98cc9fe4a4a33bcd4b93df14a (diff) | |
| download | niri-da59dfc5b4b6046475c36a377be661fbf3351bd0.tar.gz niri-da59dfc5b4b6046475c36a377be661fbf3351bd0.tar.bz2 niri-da59dfc5b4b6046475c36a377be661fbf3351bd0.zip | |
Refresh pointer focus continuously
Fixes pointer focus not updating after:
- switching workspaces
- switching between windows so they move around
- client appearing below cursor
- client resizing to appear below cursor
And all other similar cases. Hopefully this doesn't slow things down
too much. Preliminary tracy analysis seems to indicate that it doesn't.
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs index cdb9ce1b..fef72156 100644 --- a/src/input.rs +++ b/src/input.rs @@ -394,6 +394,8 @@ impl State { } let under = self.niri.surface_under_and_global_space(new_pos); + self.niri.pointer_focus = under.clone(); + let under = under.map(|u| u.surface); pointer.motion( self, @@ -435,6 +437,8 @@ impl State { let pointer = self.niri.seat.get_pointer().unwrap(); let under = self.niri.surface_under_and_global_space(pos); + self.niri.pointer_focus = under.clone(); + let under = under.map(|u| u.surface); pointer.motion( self, @@ -534,6 +538,8 @@ impl State { let pointer = self.niri.seat.get_pointer().unwrap(); let under = self.niri.surface_under_and_global_space(pos); + self.niri.pointer_focus = under.clone(); + let under = under.map(|u| u.surface); pointer.motion( self, @@ -621,6 +627,8 @@ impl State { let pointer = self.niri.seat.get_pointer().unwrap(); let under = self.niri.surface_under_and_global_space(pos); + self.niri.pointer_focus = under.clone(); + let under = under.map(|u| u.surface); pointer.motion( self, |
