ecore ecore_x_e: check 0 and -1 for ecore_x_window_prop_window_get(). According to note for ecore_x_window_prop_window_get() :

Summary:
If the property was successfully fetched the number of items stored in
val is returned, otherwise -1 is returned.
Note: Return value 0 means that the property exists but has no elements.

Reviewers: seoz

Reviewed By: seoz

CC: cedric

Differential Revision: https://phab.enlightenment.org/D457
This commit is contained in:
Seunghun Lee 2014-01-14 18:48:16 +09:00 committed by Daniel Juyung Seo
parent e465e7d58a
commit c4010a5da6
2 changed files with 8 additions and 4 deletions

View File

@ -1471,11 +1471,13 @@ EAPI Ecore_X_Window
ecore_x_e_illume_zone_get(Ecore_X_Window win)
{
Ecore_X_Window zone = 0;
int ret;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE,
&zone, 1))
ret = ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE,
&zone, 1);
if ((ret == 0) || (ret == -1))
return 0;
return zone;

View File

@ -256,10 +256,12 @@ EAPI Ecore_X_Window
ecore_x_e_illume_zone_get(Ecore_X_Window win)
{
Ecore_X_Window zone = 0;
int ret;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE,
&zone, 1))
ret = ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE,
&zone, 1);
if ((ret == 0) || (ret == -1))
return 0;
return zone;