mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Extract mapped_hit_data()
This commit is contained in:
+7
-5
@@ -2990,10 +2990,7 @@ impl Niri {
|
||||
let layer_toplevel_under = |layer| layer_surface_under(layer, false);
|
||||
let layer_popup_under = |layer| layer_surface_under(layer, true);
|
||||
|
||||
let window_under = || {
|
||||
self.layout
|
||||
.window_under(output, pos_within_output)
|
||||
.map(|(mapped, hit)| {
|
||||
let mapped_hit_data = |(mapped, hit): (&Mapped, HitType)| {
|
||||
let window = &mapped.window;
|
||||
let surface_and_pos = if let HitType::Input { win_pos } = hit {
|
||||
let win_pos_within_output = win_pos;
|
||||
@@ -3009,7 +3006,12 @@ impl Niri {
|
||||
None
|
||||
};
|
||||
(surface_and_pos, (Some((window.clone(), hit)), None))
|
||||
})
|
||||
};
|
||||
|
||||
let window_under = || {
|
||||
self.layout
|
||||
.window_under(output, pos_within_output)
|
||||
.map(mapped_hit_data)
|
||||
};
|
||||
|
||||
let mon = self.layout.monitor_for_output(output).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user