forge
Explore
Log in

Don't you dare go Hollow

layout: Remove duplicated function

Browse files at this commit

3bb7e603115d59441a700deadf11d9fd834386eaIvan MolodetskikhParent: d639eb0
src/handlers/mod.rsmodified+1 -1
@@ -373,7 +373,7 @@ impl ClientDndGrabHandler for State {
373373 // We can't even get the current pointer location because it's locked (we're deep
374374 // in the grab call stack here). So use the last known one.
375375 if let Some(output) = &self.niri.pointer_contents.output {
376- self.niri.layout.activate_output(output);
376+ self.niri.layout.focus_output(output);
377377 }
378378 }
379379 }
src/input/mod.rsmodified+4 -4
@@ -2237,7 +2237,7 @@ impl State {
22372237 let mod_down = modifiers_from_state(mods).contains(mod_key.to_modifiers());
22382238 if mod_down {
22392239 if let Some(output) = self.niri.output_under_cursor() {
2240- self.niri.layout.activate_output(&output);
2240+ self.niri.layout.focus_output(&output);
22412241
22422242 let location = pointer.current_location();
22432243 let start_data = PointerGrabStartData {
@@ -2368,7 +2368,7 @@ impl State {
23682368 // FIXME: granular.
23692369 self.niri.queue_redraw_all();
23702370 } else if let Some(output) = self.niri.output_under_cursor() {
2371- self.niri.layout.activate_output(&output);
2371+ self.niri.layout.focus_output(&output);
23722372
23732373 // FIXME: granular.
23742374 self.niri.queue_redraw_all();
@@ -2687,7 +2687,7 @@ impl State {
26872687 // FIXME: granular.
26882688 self.niri.queue_redraw_all();
26892689 } else if let Some(output) = under.output {
2690- self.niri.layout.activate_output(&output);
2690+ self.niri.layout.focus_output(&output);
26912691
26922692 // FIXME: granular.
26932693 self.niri.queue_redraw_all();
@@ -3084,7 +3084,7 @@ impl State {
30843084 // FIXME: granular.
30853085 self.niri.queue_redraw_all();
30863086 } else if let Some(output) = under.output {
3087- self.niri.layout.activate_output(&output);
3087+ self.niri.layout.focus_output(&output);
30883088
30893089 // FIXME: granular.
30903090 self.niri.queue_redraw_all();
src/layout/mod.rsmodified+0 -17
@@ -1576,23 +1576,6 @@ impl<W: LayoutElement> Layout<W> {
15761576 }
15771577 }
15781578
1579- pub fn activate_output(&mut self, output: &Output) {
1580- let MonitorSet::Normal {
1581- monitors,
1582- active_monitor_idx,
1583- ..
1584- } = &mut self.monitor_set
1585- else {
1586- return;
1587- };
1588-
1589- let idx = monitors
1590- .iter()
1591- .position(|mon| &mon.output == output)
1592- .unwrap();
1593- *active_monitor_idx = idx;
1594- }
1595-
15961579 pub fn active_output(&self) -> Option<&Output> {
15971580 let MonitorSet::Normal {
15981581 monitors,