Store hit type in PointContents
Browse files at this commit963ff14ed025eeb5d6785dbcd4c073251ef7a9e9Parent: 96a3ded2 changed files +6 -4
- src/input/mod.rs +2 -2
- src/niri.rs +4 -2
src/input/mod.rsmodified+2 -2
| @@ -2451,7 +2451,7 @@ impl State { | ||
| 2451 | 2451 | |
| 2452 | 2452 | if let Some(pos) = self.niri.tablet_cursor_location { |
| 2453 | 2453 | let under = self.niri.contents_under(pos); |
| 2454 | - if let Some(window) = under.window { | |
| 2454 | + if let Some((window, _)) = under.window { | |
| 2455 | 2455 | self.niri.layout.activate_window(&window); |
| 2456 | 2456 | |
| 2457 | 2457 | // FIXME: granular. |
| @@ -2823,7 +2823,7 @@ impl State { | ||
| 2823 | 2823 | let under = self.niri.contents_under(touch_location); |
| 2824 | 2824 | |
| 2825 | 2825 | if !handle.is_grabbed() { |
| 2826 | - if let Some(window) = under.window { | |
| 2826 | + if let Some((window, _)) = under.window { | |
| 2827 | 2827 | self.niri.layout.activate_window(&window); |
| 2828 | 2828 | |
| 2829 | 2829 | // Check if we need to start an interactive move. |
src/niri.rsmodified+4 -2
| @@ -455,7 +455,7 @@ pub struct PointContents { | ||
| 455 | 455 | // border around the window. |
| 456 | 456 | pub surface: Option<(WlSurface, Point<f64, Logical>)>, |
| 457 | 457 | // If surface belongs to a window, this is that window. |
| 458 | - pub window: Option<Window>, | |
| 458 | + pub window: Option<(Window, HitType)>, | |
| 459 | 459 | // If surface belongs to a layer surface, this is that layer surface. |
| 460 | 460 | pub layer: Option<LayerSurface>, |
| 461 | 461 | } |
| @@ -2720,7 +2720,7 @@ impl Niri { | ||
| 2720 | 2720 | } else { |
| 2721 | 2721 | None |
| 2722 | 2722 | }; |
| 2723 | - (surface_and_pos, (Some(window.clone()), None)) | |
| 2723 | + (surface_and_pos, (Some((window.clone(), hit)), None)) | |
| 2724 | 2724 | }) |
| 2725 | 2725 | }; |
| 2726 | 2726 | |
| @@ -5060,6 +5060,8 @@ impl Niri { | ||
| 5060 | 5060 | |
| 5061 | 5061 | if let Some(window) = &new_focus.window { |
| 5062 | 5062 | if current_focus.window.as_ref() != Some(window) { |
| 5063 | + let (window, _) = window; | |
| 5064 | + | |
| 5063 | 5065 | if !self.layout.should_trigger_focus_follows_mouse_on(window) { |
| 5064 | 5066 | return; |
| 5065 | 5067 | } |