diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-12-16 23:12:25 +0100 |
---|---|---|
committer | Robert Mader <robert.mader@collabora.com> | 2023-01-06 13:54:21 +0100 |
commit | 0f943d025c6e2563405d83c73983c1d9302769a8 (patch) | |
tree | 9605651c0e1d5ef16af470260b789bf61ed41092 | |
parent | a206f9654ed28903de567f20d04de68e06c4ba98 (diff) | |
download | mutter-0f943d025c6e2563405d83c73983c1d9302769a8.tar.gz |
backends: Distinguish "no EDID" from "any EDID" mapping tablets
Since the Wacom panel rewrite, the "output" setting is handled as
a kind of tri-state for display-integrated tablets:
- If the setting is unset, the device is automatically mapped
to an output
- If the setting is set and not empty, the device is mapped to
the output defined by the EDID data
- If the setting is ['', '', ''], the device is mapped to the
span of all displays, like opaque tablets do.
This distinction for the unset setting fell through the cracks,
so both "Automatic" and "All displays" options were handled as
the former.
Add this distinction, so that display-integrated tablets can
be used like opaque tablets of sorts with no limitations.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2767>
(cherry picked from commit d15c6953d8590f41e3e8b4a97dc5f78dcedec716)
-rw-r--r-- | src/backends/meta-input-mapper.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c index ae4cd05f9..e5c621a2d 100644 --- a/src/backends/meta-input-mapper.c +++ b/src/backends/meta-input-mapper.c @@ -442,6 +442,8 @@ guess_candidates (MetaInputMapper *mapper, GList *monitors, *l; gboolean builtin = FALSE; gboolean integrated = TRUE; + gboolean automatic; + g_autoptr (GVariant) user_value = NULL; #ifdef HAVE_LIBWACOM if (clutter_input_device_get_device_type (input->device) != CLUTTER_TOUCHSCREEN_DEVICE) @@ -463,6 +465,9 @@ guess_candidates (MetaInputMapper *mapper, } #endif + user_value = g_settings_get_user_value (input->settings, "output"); + automatic = user_value == NULL; + monitors = meta_monitor_manager_get_monitors (mapper->monitor_manager); for (l = monitors; l; l = l->next) @@ -472,16 +477,16 @@ guess_candidates (MetaInputMapper *mapper, g_assert (META_IS_MONITOR (l->data)); - if (integrated && match_edid (input, l->data, &edid_match)) + if (automatic && integrated && match_edid (input, l->data, &edid_match)) match.score |= 1 << edid_match; - if (integrated && match_size (input, l->data)) + if (automatic && integrated && match_size (input, l->data)) match.score |= 1 << META_MATCH_SIZE; - if (builtin && match_builtin (mapper, l->data)) + if (automatic && builtin && match_builtin (mapper, l->data)) match.score |= 1 << META_MATCH_IS_BUILTIN; - if (match_config (input, l->data)) + if (!automatic && match_config (input, l->data)) match.score |= 1 << META_MATCH_CONFIG; if (match.score > 0) |