Commit 3263084b authored by verdre's avatar verdre Committed by Marge Bot
Browse files

backends/native: Translate right coords when creating motion events

With commit 7d787688 we switched to
storing pointer coordinates in MetaInputDeviceNative instead of
ClutterInputDevice, and while we had set the coordinates of the
ClutterInputDevice in ClutterStage when queueing an event, we now set
the MetaInputDeviceNative coordinates in new_absolute_motion_event().

Here a small mistake snuck in: new_absolute_motion_event() only
translates the coordinates of the event, but we call
meta_input_device_native_set_coords() using the x and y variables
(which remain untranslated), so now the input device coordinates are no
longer translated.

Fix that by translating the coordinates of the x and y variables in case
we're we handling a tablet/stylus event instead of only translating the
event coordinates.

Fixes #1685

Part-of: <!1760>
parent ec14f51a
Pipeline #263814 passed with stages
in 20 minutes and 1 second
......@@ -514,6 +514,17 @@ new_absolute_motion_event (MetaSeatImpl *seat_impl,
seat_impl->pointer_y,
&x, &y);
}
else
{
/* This may happen early at startup */
if (seat_impl->viewports)
{
meta_input_device_native_translate_coordinates_in_impl (input_device,
seat_impl->viewports,
&x,
&y);
}
}
event->motion.time_us = time_us;
event->motion.time = us2ms (time_us);
......@@ -521,15 +532,6 @@ new_absolute_motion_event (MetaSeatImpl *seat_impl,
event->motion.x = x;
event->motion.y = y;
/* This may happen early at startup */
if (seat_impl->viewports)
{
meta_input_device_native_translate_coordinates_in_impl (input_device,
seat_impl->viewports,
&event->motion.x,
&event->motion.y);
}
event->motion.axes = axes;
clutter_event_set_device (event, seat_impl->core_pointer);
clutter_event_set_source_device (event, input_device);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment