input: Make sure to update internal pointer position state on tool input

This commit is contained in:
Victoria Brekenfeld 2026-08-18 19:15:03 +02:00 • committed by Victoria Brekenfeld
parent 67aa6a0c49
commit a66f629a4e

View file

@ -1590,6 +1590,7 @@ impl State {
return; return;
}; };
let current_output = seat.active_output();
let position = let position =
transform_output_mapped_position(&output, &event, shell.zoom_state()); transform_output_mapped_position(&output, &event, shell.zoom_state());
let under = State::surface_under(position, &output, &shell) let under = State::surface_under(position, &output, &shell)
@ -1652,6 +1653,29 @@ impl State {
tool.frame(self, event.time()); tool.frame(self, event.time());
} }
let mut shell = self.common.shell.write();
shell.update_pointer_position(position.to_local(&output), &output);
shell.update_focal_point(
&seat,
position,
self.common.config.cosmic_conf.accessibility_zoom.view_moves,
);
if output != current_output {
for session in cursor_sessions_for_output(&shell, &current_output) {
session.set_cursor_pos(None);
}
seat.set_active_output(&output);
}
update_output_image_copy_cursor_position(
&shell,
&self.common.clock,
&output,
&seat,
position,
);
} }
} }
InputEvent::TabletToolProximity { event, .. } => { InputEvent::TabletToolProximity { event, .. } => {
@ -1670,6 +1694,7 @@ impl State {
return; return;
}; };
let current_output = seat.active_output();
let position = let position =
transform_output_mapped_position(&output, &event, shell.zoom_state()); transform_output_mapped_position(&output, &event, shell.zoom_state());
let under = State::surface_under(position, &output, &shell) let under = State::surface_under(position, &output, &shell)
@ -1761,6 +1786,29 @@ impl State {
tool.frame(self, event.time()); tool.frame(self, event.time());
} }
let mut shell = self.common.shell.write();
shell.update_pointer_position(position.to_local(&output), &output);
shell.update_focal_point(
&seat,
position,
self.common.config.cosmic_conf.accessibility_zoom.view_moves,
);
if output != current_output {
for session in cursor_sessions_for_output(&shell, &current_output) {
session.set_cursor_pos(None);
}
seat.set_active_output(&output);
}
update_output_image_copy_cursor_position(
&shell,
&self.common.clock,
&output,
&seat,
position,
);
} }
} }
InputEvent::TabletToolTip { event, .. } => { InputEvent::TabletToolTip { event, .. } => {