diff options
author | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2023-04-14 18:10:36 +0800 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-04-18 20:18:01 +0000 |
commit | dd6be7cf2ae16c30b315f538367e69300af9d4b9 (patch) | |
tree | db44b7aa91e20cfeb5310aaeb53fd9c9d3b8428e /src/backends/x11 | |
parent | 86b5d9d809546127525da39a7727b097cacf96a3 (diff) | |
download | mutter-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.c | 12 |
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); } |