Use Global coordinate instead of inferring as Logical

Inference behavior can be confusing, and the coordinate here is global,
so use `Global` like the `PointerMotion*` event handlers.
This commit is contained in:
Ian Douglas Scott 2026-07-14 15:04:53 -07:00 committed by Victoria Brekenfeld
parent 2648aea0df
commit c92c18e09e

View file

@ -2437,7 +2437,7 @@ impl State {
if is_legal(pos_in_element) { if is_legal(pos_in_element) {
let x = workspace_origin.x + origin.x + pos_in_element.x; let x = workspace_origin.x + origin.x + pos_in_element.x;
let y = workspace_origin.y + origin.y + pos_in_element.y; let y = workspace_origin.y + origin.y + pos_in_element.y;
Some((Point::new(x, y), output.clone())) Some((Point::<_, Global>::new(x, y), output.clone()))
} else { } else {
None None
} }
@ -2448,10 +2448,10 @@ impl State {
if let Some((point, output)) = point_and_output { if let Some((point, output)) = point_and_output {
let original_position = pointer.current_location(); let original_position = pointer.current_location();
pointer.set_location(point); pointer.set_location(point.as_logical());
let mut shell = self.common.shell.write(); let mut shell = self.common.shell.write();
shell.update_pointer_position(point.as_global().to_local(&output), &output); shell.update_pointer_position(point.to_local(&output), &output);
let seat = shell let seat = shell
.seats .seats
@ -2469,7 +2469,7 @@ impl State {
let output_geometry = output.geometry(); let output_geometry = output.geometry();
for session in cursor_sessions_for_output(&shell, &output) { for session in cursor_sessions_for_output(&shell, &output) {
if let Some(cursor_geometry) = seat.cursor_geometry( if let Some(cursor_geometry) = seat.cursor_geometry(
point.to_buffer( point.as_logical().to_buffer(
output.current_scale().fractional_scale(), output.current_scale().fractional_scale(),
output.current_transform(), output.current_transform(),
&output_geometry.size.to_f64().as_logical(), &output_geometry.size.to_f64().as_logical(),