forge
Explore
Log in

Don't you dare go Hollow

Store hit type in PointContents

Browse files at this commit

963ff14ed025eeb5d6785dbcd4c073251ef7a9e9Ivan MolodetskikhParent: 96a3ded
src/input/mod.rsmodified+2 -2
@@ -2451,7 +2451,7 @@ impl State {
2451 2451
2452 if let Some(pos) = self.niri.tablet_cursor_location {2452 if let Some(pos) = self.niri.tablet_cursor_location {
2453 let under = self.niri.contents_under(pos);2453 let under = self.niri.contents_under(pos);
2454- if let Some(window) = under.window {2454+ if let Some((window, _)) = under.window {
2455 self.niri.layout.activate_window(&window);2455 self.niri.layout.activate_window(&window);
2456 2456
2457 // FIXME: granular.2457 // FIXME: granular.
@@ -2823,7 +2823,7 @@ impl State {
2823 let under = self.niri.contents_under(touch_location);2823 let under = self.niri.contents_under(touch_location);
2824 2824
2825 if !handle.is_grabbed() {2825 if !handle.is_grabbed() {
2826- if let Some(window) = under.window {2826+ if let Some((window, _)) = under.window {
2827 self.niri.layout.activate_window(&window);2827 self.niri.layout.activate_window(&window);
2828 2828
2829 // Check if we need to start an interactive move.2829 // Check if we need to start an interactive move.
src/niri.rsmodified+4 -2
@@ -455,7 +455,7 @@ pub struct PointContents {
455 // border around the window.455 // border around the window.
456 pub surface: Option<(WlSurface, Point<f64, Logical>)>,456 pub surface: Option<(WlSurface, Point<f64, Logical>)>,
457 // If surface belongs to a window, this is that window.457 // If surface belongs to a window, this is that window.
458- pub window: Option<Window>,458+ pub window: Option<(Window, HitType)>,
459 // If surface belongs to a layer surface, this is that layer surface.459 // If surface belongs to a layer surface, this is that layer surface.
460 pub layer: Option<LayerSurface>,460 pub layer: Option<LayerSurface>,
461 }461 }
@@ -2720,7 +2720,7 @@ impl Niri {
2720 } else {2720 } else {
2721 None2721 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 if let Some(window) = &new_focus.window {5061 if let Some(window) = &new_focus.window {
5062 if current_focus.window.as_ref() != Some(window) {5062 if current_focus.window.as_ref() != Some(window) {
5063+ let (window, _) = window;
5064+
5063 if !self.layout.should_trigger_focus_follows_mouse_on(window) {5065 if !self.layout.should_trigger_focus_follows_mouse_on(window) {
5064 return;5066 return;
5065 }5067 }