diff --git a/.mutter.metadata b/.mutter.metadata new file mode 100644 index 0000000..6e225f3 --- /dev/null +++ b/.mutter.metadata @@ -0,0 +1 @@ +f9b20f8330ecdb76fc887c4a99c03b406e26fd66 mutter-40.9.tar.xz diff --git a/0001-backends-Disambiguate-output-mapped-to-tablet-with-c.patch b/0001-backends-Disambiguate-output-mapped-to-tablet-with-c.patch new file mode 100644 index 0000000..ebeebda --- /dev/null +++ b/0001-backends-Disambiguate-output-mapped-to-tablet-with-c.patch @@ -0,0 +1,106 @@ +From 8d340beb368b3b59637c91e2e6e4adbc81ce7caf Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Wed, 7 Feb 2024 21:27:32 +0100 +Subject: [PATCH] backends: Disambiguate output mapped to tablet with connector + name + +In some circumstances, we may end up with outputs with the same +vendor/product/serial, in which case we have a hard time finding the +right one to map tablets to, since configuration only has these 3 +pieces of data. + +Add the handling of a 4th argument containing the output name +based on the connector (e.g. HDMI-1), so that it can be used to +disambiguate the output if necessary. + +This only kicks in if there actually are multiple outputs with the +same EDID data. A goal of the configuration as it was stored was to +remain useful if the user changed how the device is physically +connected to the computer, this remains true for the vast majority +of users having a single thing of each. +--- + src/backends/meta-input-mapper.c | 43 +++++++++++++++++++++++++++++--- + 1 file changed, 39 insertions(+), 4 deletions(-) + +diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c +index ae4cd05..a0a4b8a 100644 +--- a/src/backends/meta-input-mapper.c ++++ b/src/backends/meta-input-mapper.c +@@ -395,9 +395,33 @@ match_builtin (MetaInputMapper *mapper, + return monitor == meta_monitor_manager_get_laptop_panel (mapper->monitor_manager); + } + ++static gboolean ++monitor_has_twin (MetaMonitor *monitor, ++ GList *monitors) ++{ ++ GList *l; ++ ++ for (l = monitors; l; l = l->next) ++ { ++ if (l->data == monitor) ++ continue; ++ ++ if (g_strcmp0 (meta_monitor_get_vendor (monitor), ++ meta_monitor_get_vendor (l->data)) == 0 && ++ g_strcmp0 (meta_monitor_get_product (monitor), ++ meta_monitor_get_product (l->data)) == 0 && ++ g_strcmp0 (meta_monitor_get_serial (monitor), ++ meta_monitor_get_serial (l->data)) == 0) ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ + static gboolean + match_config (MetaMapperInputInfo *info, +- MetaMonitor *monitor) ++ MetaMonitor *monitor, ++ GList *monitors) + { + gboolean match = FALSE; + char **edid; +@@ -406,10 +430,10 @@ match_config (MetaMapperInputInfo *info, + edid = g_settings_get_strv (info->settings, "output"); + n_values = g_strv_length (edid); + +- if (n_values != 3) ++ if (n_values < 3) + { + g_warning ("EDID configuration for device '%s' " +- "is incorrect, must have 3 values", ++ "is incorrect, must have at least 3 values", + clutter_input_device_get_device_name (info->device)); + goto out; + } +@@ -421,6 +445,17 @@ match_config (MetaMapperInputInfo *info, + g_strcmp0 (meta_monitor_get_product (monitor), edid[1]) == 0 && + g_strcmp0 (meta_monitor_get_serial (monitor), edid[2]) == 0); + ++ if (match && n_values >= 4 && monitor_has_twin (monitor, monitors)) ++ { ++ /* The 4th value if set contains the ID (e.g. HDMI-1), use it ++ * for disambiguation if multiple monitors with the same ++ * EDID data are found. ++ */ ++ MetaOutput *output; ++ output = meta_monitor_get_main_output (monitor); ++ match = g_strcmp0 (meta_output_get_name (output), edid[3]) == 0; ++ } ++ + out: + g_strfreev (edid); + +@@ -481,7 +516,7 @@ guess_candidates (MetaInputMapper *mapper, + if (builtin && match_builtin (mapper, l->data)) + match.score |= 1 << META_MATCH_IS_BUILTIN; + +- if (match_config (input, l->data)) ++ if (match_config (input, l->data, monitors)) + match.score |= 1 << META_MATCH_CONFIG; + + if (match.score > 0) +-- +2.43.0 + diff --git a/mutter.spec b/mutter.spec index 18d8924..85d014c 100644 --- a/mutter.spec +++ b/mutter.spec @@ -10,7 +10,7 @@ Name: mutter Version: 40.9 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Window and compositing manager based on Clutter License: GPLv2+ @@ -113,6 +113,8 @@ Patch46: 0001-clutter-text-Don-t-query-preferred-size-without-allo.patch Patch47: 0001-core-Change-MetaWaylandTextInput-event-forwarding-to.patch +Patch48: 0001-backends-Disambiguate-output-mapped-to-tablet-with-c.patch + BuildRequires: chrpath BuildRequires: pango-devel BuildRequires: startup-notification-devel @@ -260,6 +262,10 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop %{_datadir}/mutter-%{mutter_api_version}/tests %changelog +* Tue Feb 06 2024 Carlos Garnacho - 40.9-16 +- Disambiguate output mapped to tablet with connector name + Resolves: RHEL-28535 + * Mon Jul 10 2023 Carlos Garnacho - 40.9-15 - Fix ordering of keyboard modifiers relative to other keyboard events Resolves: #2218146