input-settings-x11: don't create non-existing atoms

If the atom doesn't exist it won't exist on the device either so we can
shortcut the property retrieval/modification. Creating atoms by name but not
doing anything with them also confuses kcm_touchpad

https://bugzilla.redhat.com/show_bug.cgi?id=1199825

https://bugzilla.gnome.org/show_bug.cgi?id=751471
This commit is contained in:
Peter Hutterer 2015-06-25 07:55:52 +10:00 committed by Jasper St. Pierre
parent dd060d78ce
commit b55f792302

View File

@ -50,7 +50,10 @@ get_property (ClutterInputDevice *device,
Atom property_atom, type_ret; Atom property_atom, type_ret;
guchar *data_ret = NULL; guchar *data_ret = NULL;
property_atom = XInternAtom (xdisplay, property, False); property_atom = XInternAtom (xdisplay, property, True);
if (!property_atom)
return NULL;
device_id = clutter_input_device_get_device_id (device); device_id = clutter_input_device_get_device_id (device);
rc = XIGetProperty (xdisplay, device_id, property_atom, rc = XIGetProperty (xdisplay, device_id, property_atom,
@ -82,7 +85,10 @@ change_property (ClutterInputDevice *device,
Atom property_atom; Atom property_atom;
guchar *data_ret; guchar *data_ret;
property_atom = XInternAtom (xdisplay, property, False); property_atom = XInternAtom (xdisplay, property, True);
if (!property_atom)
return;
device_id = clutter_input_device_get_device_id (device); device_id = clutter_input_device_get_device_id (device);
data_ret = get_property (device, property, type, format, nitems); data_ret = get_property (device, property, type, format, nitems);