Fix check for XIGetProperty

Summary: The function XIGetProperty returns 0 on success. More info on the function here: https://www.x.org/releases/X11R7.5/doc/man/man3/XIGetProperty.3.html

Reviewers: raster, stefan_schmidt, bu5hm4n

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10978
This commit is contained in:
rafspiny 2019-12-28 22:06:17 +00:00 committed by Carsten Haitzler (Rasterman)
parent f989cea52d
commit d8b2cf28b1
1 changed files with 3 additions and 2 deletions

View File

@ -1035,9 +1035,10 @@ ecore_x_input_device_property_get(int slot, const char *prop, int *num_ret,
if ((slot < 0) || (slot >= _ecore_x_xi2_num)) goto err;
a = XInternAtom(_ecore_x_disp, prop, False);
if (!XIGetProperty(_ecore_x_disp, _ecore_x_xi2_devs[slot].deviceid,
// XIGetProperty returns 0 AKA `Success` if everything is good
if (XIGetProperty(_ecore_x_disp, _ecore_x_xi2_devs[slot].deviceid,
a, 0, 65536, False, AnyPropertyType, &a_type, &fmt,
&num, &dummy, &data)) goto err;
&num, &dummy, &data) != 0) goto err;
*format_ret = a_type;
*num_ret = num;
*unit_size_ret = fmt;