Implement focus-follows-mouse max-scroll-amount

This commit is contained in:
Ivan Molodetskikh
2024-07-05 20:12:56 +04:00
parent 120eaa6c56
commit 1da99f4003
6 changed files with 116 additions and 6 deletions
+16
View File
@@ -947,6 +947,22 @@ impl<W: LayoutElement> Layout<W> {
}
}
pub fn scroll_amount_to_activate(&self, window: &W::Id) -> f64 {
let MonitorSet::Normal { monitors, .. } = &self.monitor_set else {
return 0.;
};
for mon in monitors {
for ws in &mon.workspaces {
if ws.has_window(window) {
return ws.scroll_amount_to_activate(window);
}
}
}
0.
}
pub fn activate_window(&mut self, window: &W::Id) {
let MonitorSet::Normal {
monitors,