Move clones up from find_window_and_output

This commit is contained in:
Ivan Molodetskikh
2023-12-24 17:38:13 +04:00
parent ed3080d908
commit be2e551a89
5 changed files with 23 additions and 13 deletions
+2 -2
View File
@@ -477,12 +477,12 @@ impl<W: LayoutElement> Layout<W> {
}
}
pub fn find_window_and_output(&self, wl_surface: &WlSurface) -> Option<(W, Output)> {
pub fn find_window_and_output(&self, wl_surface: &WlSurface) -> Option<(&W, &Output)> {
if let MonitorSet::Normal { monitors, .. } = &self.monitor_set {
for mon in monitors {
for ws in &mon.workspaces {
if let Some(window) = ws.find_wl_surface(wl_surface) {
return Some((window.clone(), mon.output.clone()));
return Some((window, &mon.output));
}
}
}