feat: shake cursor to find by magnifying the cursor

This commit is contained in:
Hojjat 2026-07-20 16:11:13 -06:00 • committed by Victoria Brekenfeld
parent 04026259e0
commit f20de50e41
7 changed files with 205 additions and 7 deletions

View file

@ -337,6 +337,21 @@ impl State {
notify_cursor_activity(self, &seat);
let current_output = seat.active_output();
if self.common.config.cosmic_conf.cursor_shake_to_find
&& let Some(cursor_state) =
seat.user_data()
.get::<crate::backend::render::cursor::CursorState>()
{
let active = {
let mut cursor = cursor_state.lock().unwrap();
cursor.detect_shake(event.delta(), std::time::Instant::now());
cursor.is_magnifying()
};
if active {
self.backend.schedule_render(&current_output);
}
}
let mut position = seat.get_pointer().unwrap().current_location().as_global();
let under = State::surface_under(position, &current_output, &shell)