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 {
373 // We can't even get the current pointer location because it's locked (we're deep373 // We can't even get the current pointer location because it's locked (we're deep
374 // in the grab call stack here). So use the last known one.374 // in the grab call stack here). So use the last known one.
375 if let Some(output) = &self.niri.pointer_contents.output {375 if let Some(output) = &self.niri.pointer_contents.output {
376- self.niri.layout.activate_output(output);376+ self.niri.layout.focus_output(output);
377 }377 }
378 }378 }
379 }379 }
src/input/mod.rsmodified+4 -4
@@ -2237,7 +2237,7 @@ impl State {
2237 let mod_down = modifiers_from_state(mods).contains(mod_key.to_modifiers());2237 let mod_down = modifiers_from_state(mods).contains(mod_key.to_modifiers());
2238 if mod_down {2238 if mod_down {
2239 if let Some(output) = self.niri.output_under_cursor() {2239 if let Some(output) = self.niri.output_under_cursor() {
2240- self.niri.layout.activate_output(&output);2240+ self.niri.layout.focus_output(&output);
2241 2241
2242 let location = pointer.current_location();2242 let location = pointer.current_location();
2243 let start_data = PointerGrabStartData {2243 let start_data = PointerGrabStartData {
@@ -2368,7 +2368,7 @@ impl State {
2368 // FIXME: granular.2368 // FIXME: granular.
2369 self.niri.queue_redraw_all();2369 self.niri.queue_redraw_all();
2370 } else if let Some(output) = self.niri.output_under_cursor() {2370 } else if let Some(output) = self.niri.output_under_cursor() {
2371- self.niri.layout.activate_output(&output);2371+ self.niri.layout.focus_output(&output);
2372 2372
2373 // FIXME: granular.2373 // FIXME: granular.
2374 self.niri.queue_redraw_all();2374 self.niri.queue_redraw_all();
@@ -2687,7 +2687,7 @@ impl State {
2687 // FIXME: granular.2687 // FIXME: granular.
2688 self.niri.queue_redraw_all();2688 self.niri.queue_redraw_all();
2689 } else if let Some(output) = under.output {2689 } else if let Some(output) = under.output {
2690- self.niri.layout.activate_output(&output);2690+ self.niri.layout.focus_output(&output);
2691 2691
2692 // FIXME: granular.2692 // FIXME: granular.
2693 self.niri.queue_redraw_all();2693 self.niri.queue_redraw_all();
@@ -3084,7 +3084,7 @@ impl State {
3084 // FIXME: granular.3084 // FIXME: granular.
3085 self.niri.queue_redraw_all();3085 self.niri.queue_redraw_all();
3086 } else if let Some(output) = under.output {3086 } else if let Some(output) = under.output {
3087- self.niri.layout.activate_output(&output);3087+ self.niri.layout.focus_output(&output);
3088 3088
3089 // FIXME: granular.3089 // FIXME: granular.
3090 self.niri.queue_redraw_all();3090 self.niri.queue_redraw_all();
src/layout/mod.rsmodified+0 -17
@@ -1576,23 +1576,6 @@ impl<W: LayoutElement> Layout<W> {
1576 }1576 }
1577 }1577 }
1578 1578
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-
1596 pub fn active_output(&self) -> Option<&Output> {1579 pub fn active_output(&self) -> Option<&Output> {
1597 let MonitorSet::Normal {1580 let MonitorSet::Normal {
1598 monitors,1581 monitors,