mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
layout: Remove duplicated function
This commit is contained in:
+1
-1
@@ -373,7 +373,7 @@ impl ClientDndGrabHandler for State {
|
|||||||
// We can't even get the current pointer location because it's locked (we're deep
|
// We can't even get the current pointer location because it's locked (we're deep
|
||||||
// in the grab call stack here). So use the last known one.
|
// in the grab call stack here). So use the last known one.
|
||||||
if let Some(output) = &self.niri.pointer_contents.output {
|
if let Some(output) = &self.niri.pointer_contents.output {
|
||||||
self.niri.layout.activate_output(output);
|
self.niri.layout.focus_output(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -2237,7 +2237,7 @@ impl State {
|
|||||||
let mod_down = modifiers_from_state(mods).contains(mod_key.to_modifiers());
|
let mod_down = modifiers_from_state(mods).contains(mod_key.to_modifiers());
|
||||||
if mod_down {
|
if mod_down {
|
||||||
if let Some(output) = self.niri.output_under_cursor() {
|
if let Some(output) = self.niri.output_under_cursor() {
|
||||||
self.niri.layout.activate_output(&output);
|
self.niri.layout.focus_output(&output);
|
||||||
|
|
||||||
let location = pointer.current_location();
|
let location = pointer.current_location();
|
||||||
let start_data = PointerGrabStartData {
|
let start_data = PointerGrabStartData {
|
||||||
@@ -2368,7 +2368,7 @@ impl State {
|
|||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
} else if let Some(output) = self.niri.output_under_cursor() {
|
} else if let Some(output) = self.niri.output_under_cursor() {
|
||||||
self.niri.layout.activate_output(&output);
|
self.niri.layout.focus_output(&output);
|
||||||
|
|
||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
@@ -2687,7 +2687,7 @@ impl State {
|
|||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
} else if let Some(output) = under.output {
|
} else if let Some(output) = under.output {
|
||||||
self.niri.layout.activate_output(&output);
|
self.niri.layout.focus_output(&output);
|
||||||
|
|
||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
@@ -3084,7 +3084,7 @@ impl State {
|
|||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
} else if let Some(output) = under.output {
|
} else if let Some(output) = under.output {
|
||||||
self.niri.layout.activate_output(&output);
|
self.niri.layout.focus_output(&output);
|
||||||
|
|
||||||
// FIXME: granular.
|
// FIXME: granular.
|
||||||
self.niri.queue_redraw_all();
|
self.niri.queue_redraw_all();
|
||||||
|
|||||||
@@ -1576,23 +1576,6 @@ impl<W: LayoutElement> Layout<W> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn activate_output(&mut self, output: &Output) {
|
|
||||||
let MonitorSet::Normal {
|
|
||||||
monitors,
|
|
||||||
active_monitor_idx,
|
|
||||||
..
|
|
||||||
} = &mut self.monitor_set
|
|
||||||
else {
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
|
|
||||||
let idx = monitors
|
|
||||||
.iter()
|
|
||||||
.position(|mon| &mon.output == output)
|
|
||||||
.unwrap();
|
|
||||||
*active_monitor_idx = idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn active_output(&self) -> Option<&Output> {
|
pub fn active_output(&self) -> Option<&Output> {
|
||||||
let MonitorSet::Normal {
|
let MonitorSet::Normal {
|
||||||
monitors,
|
monitors,
|
||||||
|
|||||||
Reference in New Issue
Block a user