mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
backends/native: Change handling of display mapping for rel tablet tools
We avoided setting the device matrix applying to the tablet tool (used if the tablet is in absolute coordinates mode) if the device is configured for relative motion, but forgot to apply the matrix if changing the device back to absolute mode, this made the device seemingly forget its attached display until later configuration changes. In order to avoid the hassle of looking up the right display again on unrelated configuration changes, make the matrix be always set on the device, but only actually used in absolute coordinates mode. This makes the device able to seamlessly switch between modes and remain mapped to the right display. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3012>
This commit is contained in:
parent
558f3156dc
commit
ee412cc4a3
@ -1592,6 +1592,9 @@ meta_input_device_native_translate_coordinates_in_impl (ClutterInputDevice *devi
|
||||
float stage_width, stage_height;
|
||||
double x_d, y_d;
|
||||
|
||||
if (device_evdev->mapping_mode == META_INPUT_DEVICE_MAPPING_RELATIVE)
|
||||
return;
|
||||
|
||||
meta_viewport_info_get_extents (viewports, &stage_width, &stage_height);
|
||||
x_d = *x / stage_width;
|
||||
y_d = *y / stage_height;
|
||||
|
@ -138,20 +138,9 @@ set_matrix (GTask *task)
|
||||
float *matrix = g_task_get_task_data (task);
|
||||
cairo_matrix_t dev_matrix;
|
||||
|
||||
if (clutter_input_device_get_device_type (device) ==
|
||||
CLUTTER_TOUCHSCREEN_DEVICE ||
|
||||
meta_input_device_native_get_mapping_mode_in_impl (device) ==
|
||||
META_INPUT_DEVICE_MAPPING_ABSOLUTE)
|
||||
{
|
||||
cairo_matrix_init (&dev_matrix,
|
||||
matrix[0], matrix[3], matrix[1],
|
||||
matrix[4], matrix[2], matrix[5]);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_matrix_init_identity (&dev_matrix);
|
||||
}
|
||||
|
||||
g_object_set (device, "device-matrix", &dev_matrix, NULL);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
|
Loading…
Reference in New Issue
Block a user