backends: Fold device mapping check into backend

Make the upper part agnostic about the device being relative in order
to avoid applying keep-aspect. The X11 bits already are, so make it
sure it's also the case for the native backend.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
This commit is contained in:
Carlos Garnacho 2020-05-06 20:20:49 +02:00
parent 88f03d3a26
commit 7fafec21b6
2 changed files with 7 additions and 11 deletions

View File

@ -1050,17 +1050,9 @@ update_tablet_keep_aspect (MetaInputSettings *input_settings,
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings); input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
if (clutter_input_device_get_mapping_mode (device) == keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE) meta_input_settings_find_monitor (input_settings, settings, device,
{ NULL, &logical_monitor);
keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
meta_input_settings_find_monitor (input_settings, settings, device,
NULL, &logical_monitor);
}
else
{
keep_aspect = FALSE;
}
input_settings_class->set_tablet_keep_aspect (input_settings, device, input_settings_class->set_tablet_keep_aspect (input_settings, device,
logical_monitor, keep_aspect); logical_monitor, keep_aspect);

View File

@ -522,6 +522,10 @@ meta_input_settings_native_set_tablet_keep_aspect (MetaInputSettings *settings,
{ {
double aspect_ratio = 0; double aspect_ratio = 0;
if (clutter_input_device_get_mapping_mode (device) ==
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE)
keep_aspect = FALSE;
if (keep_aspect) if (keep_aspect)
{ {
int width, height; int width, height;