summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2020-09-09 10:15:32 +0100
committerJonas Ã…dahl <jadahl@gmail.com>2020-09-14 17:31:32 +0000
commite74b065fb5cad4126d823d476736b3829637762f (patch)
tree0e87821e5cac4439dca5042b23d826e0ff8475bd
parentaf9df1e5b62b253e5f1d5f6eff89e45e3bed81b3 (diff)
downloadmutter-wip/smcv/issue1414.tar.gz
input-mapper: Don't match touchscreens to the absence of a monitorwip/smcv/issue1414
If there is no laptop panel (for example on a desktop PC or a virtual machine), attempting to put a NULL monitor in the list of matches will just make mapping_helper_apply() crash. Mitigates: https://gitlab.gnome.org/GNOME/mutter/-/issues/1414 Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r--src/backends/meta-input-mapper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index 64be9f96a..db85d0926 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -367,6 +367,8 @@ guess_candidates (MetaInputMapper *mapper,
MetaOutputMatchType edid_match;
DeviceMatch match = { l->data, 0 };
+ g_assert (META_IS_MONITOR (l->data));
+
if (match_edid (input, l->data, &edid_match))
match.score |= 1 << edid_match;
@@ -386,7 +388,10 @@ guess_candidates (MetaInputMapper *mapper,
match.monitor =
meta_monitor_manager_get_laptop_panel (mapper->monitor_manager);
- g_array_append_val (info->matches, match);
+
+ if (match.monitor != NULL)
+ g_array_append_val (info->matches, match);
+
info->best = 0;
}
else