mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Store hit type in PointContents
This commit is contained in:
+2
-2
@@ -2451,7 +2451,7 @@ impl State {
|
||||
|
||||
if let Some(pos) = self.niri.tablet_cursor_location {
|
||||
let under = self.niri.contents_under(pos);
|
||||
if let Some(window) = under.window {
|
||||
if let Some((window, _)) = under.window {
|
||||
self.niri.layout.activate_window(&window);
|
||||
|
||||
// FIXME: granular.
|
||||
@@ -2823,7 +2823,7 @@ impl State {
|
||||
let under = self.niri.contents_under(touch_location);
|
||||
|
||||
if !handle.is_grabbed() {
|
||||
if let Some(window) = under.window {
|
||||
if let Some((window, _)) = under.window {
|
||||
self.niri.layout.activate_window(&window);
|
||||
|
||||
// Check if we need to start an interactive move.
|
||||
|
||||
+4
-2
@@ -455,7 +455,7 @@ pub struct PointContents {
|
||||
// border around the window.
|
||||
pub surface: Option<(WlSurface, Point<f64, Logical>)>,
|
||||
// If surface belongs to a window, this is that window.
|
||||
pub window: Option<Window>,
|
||||
pub window: Option<(Window, HitType)>,
|
||||
// If surface belongs to a layer surface, this is that layer surface.
|
||||
pub layer: Option<LayerSurface>,
|
||||
}
|
||||
@@ -2720,7 +2720,7 @@ impl Niri {
|
||||
} else {
|
||||
None
|
||||
};
|
||||
(surface_and_pos, (Some(window.clone()), None))
|
||||
(surface_and_pos, (Some((window.clone(), hit)), None))
|
||||
})
|
||||
};
|
||||
|
||||
@@ -5060,6 +5060,8 @@ impl Niri {
|
||||
|
||||
if let Some(window) = &new_focus.window {
|
||||
if current_focus.window.as_ref() != Some(window) {
|
||||
let (window, _) = window;
|
||||
|
||||
if !self.layout.should_trigger_focus_follows_mouse_on(window) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user