summaryrefslogtreecommitdiff
path: root/src/backends/x11
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2023-04-14 18:10:36 +0800
committerMarge Bot <marge-bot@gnome.org>2023-04-18 20:18:01 +0000
commitdd6be7cf2ae16c30b315f538367e69300af9d4b9 (patch)
treedb44b7aa91e20cfeb5310aaeb53fd9c9d3b8428e /src/backends/x11
parent86b5d9d809546127525da39a7727b097cacf96a3 (diff)
downloadmutter-dd6be7cf2ae16c30b315f538367e69300af9d4b9.tar.gz
backends/x11: Trap errors from XIChangeProperty
And report them as warnings instead of crashing. https://launchpad.net/bugs/2014986 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2960>
Diffstat (limited to 'src/backends/x11')
-rw-r--r--src/backends/x11/meta-input-settings-x11.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backends/x11/meta-input-settings-x11.c b/src/backends/x11/meta-input-settings-x11.c
index 402235159..9a0b37e29 100644
--- a/src/backends/x11/meta-input-settings-x11.c
+++ b/src/backends/x11/meta-input-settings-x11.c
@@ -170,6 +170,7 @@ change_property (MetaInputSettings *settings,
int device_id;
Atom property_atom;
guchar *data_ret;
+ int err;
property_atom = XInternAtom (xdisplay, property, True);
if (!property_atom)
@@ -181,8 +182,19 @@ change_property (MetaInputSettings *settings,
if (!data_ret)
return;
+ meta_clutter_x11_trap_x_errors ();
XIChangeProperty (xdisplay, device_id, property_atom, type,
format, XIPropModeReplace, data, nitems);
+ XSync (xdisplay, False);
+ err = meta_clutter_x11_untrap_x_errors ();
+ if (err)
+ {
+ g_warning ("XIChangeProperty failed on device %d property \"%s\" with X error %d",
+ device_id,
+ property,
+ err);
+ }
+
meta_XFree (data_ret);
}