[gnome-flashback] input-settings: add error trap around call to XIGetProperty



commit c6db2659b2fa0c23a9aae33c5958ae4b190cd54c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Feb 18 20:12:29 2020 +0200

    input-settings: add error trap around call to XIGetProperty
    
    https://gitlab.gnome.org/GNOME/mutter/commit/5afec87b96828424a4a35

 gnome-flashback/libinput-settings/gf-input-settings.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gnome-flashback/libinput-settings/gf-input-settings.c 
b/gnome-flashback/libinput-settings/gf-input-settings.c
index 629da7f..d61bfbb 100644
--- a/gnome-flashback/libinput-settings/gf-input-settings.c
+++ b/gnome-flashback/libinput-settings/gf-input-settings.c
@@ -91,6 +91,7 @@ get_property (GfInputSettings *settings,
 {
   Atom property_atom;
   gint device_id;
+  GdkDisplay *display;
   gint rc;
   Atom type_ret;
   gint format_ret;
@@ -105,10 +106,15 @@ get_property (GfInputSettings *settings,
   device_id = gdk_x11_device_get_id (device);
   data_ret = NULL;
 
+  display = gdk_display_get_default ();
+  gdk_x11_display_error_trap_push (display);
+
   rc = XIGetProperty (settings->xdisplay, device_id, property_atom,
                       0, 10, False, type, &type_ret, &format_ret,
                       &nitems_ret, &bytes_after_ret, &data_ret);
 
+  gdk_x11_display_error_trap_pop_ignored (display);
+
   if (rc == Success && type_ret == type && format_ret == format && nitems_ret >= nitems)
     {
       if (nitems_ret > nitems)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]