mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 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
|
||||
// in the grab call stack here). So use the last known one.
|
||||
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());
|
||||
if mod_down {
|
||||
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 start_data = PointerGrabStartData {
|
||||
@@ -2368,7 +2368,7 @@ impl State {
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
} else if let Some(output) = self.niri.output_under_cursor() {
|
||||
self.niri.layout.activate_output(&output);
|
||||
self.niri.layout.focus_output(&output);
|
||||
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
@@ -2687,7 +2687,7 @@ impl State {
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
} else if let Some(output) = under.output {
|
||||
self.niri.layout.activate_output(&output);
|
||||
self.niri.layout.focus_output(&output);
|
||||
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
@@ -3084,7 +3084,7 @@ impl State {
|
||||
// FIXME: granular.
|
||||
self.niri.queue_redraw_all();
|
||||
} else if let Some(output) = under.output {
|
||||
self.niri.layout.activate_output(&output);
|
||||
self.niri.layout.focus_output(&output);
|
||||
|
||||
// FIXME: granular.
|
||||
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> {
|
||||
let MonitorSet::Normal {
|
||||
monitors,
|
||||
|
||||
Reference in New Issue
Block a user