aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-12-02 12:40:56 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-12-02 12:46:18 +0900
commite2467724da55a64138286b433db16f3b59e33175 (patch)
tree5546be3b5711faa641493b1690955815763e9720
parentNEWS: added EFL 1.9.0 NEWS entry. (diff)
downloadefl-e2467724da55a64138286b433db16f3b59e33175.tar.gz
ecore ecore_x_e: check 0 and -1 for ecore_x_window_prop_card32_get() return value which mean fail.
- ecore_x_window_prop_card32_get() returns: -1 if the property was not successfully fetched. 0 if the property exists but has no elements.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS2
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_e.c66
3 files changed, 48 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ddd4556bb..a772e501d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-02 Daniel Juyung Seo (SeoZ)
+
+ * Check ecore_x_window_prop_card32_get() return value correctly in ecore_x_e.
+
2013-12-01 Carsten Haitzler (The Rasterman)
* 1.8 release
diff --git a/NEWS b/NEWS
index 63e87dace1..f662b751b1 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Improvements:
Fixes:
+ * Check ecore_x_window_prop_card32_get() return value correctly in ecore_x_e.
+
Removals:
diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c
index 64c9944876..be9f7f44e0 100644
--- a/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -55,10 +55,12 @@ EAPI Eina_Bool
ecore_x_e_virtual_keyboard_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
@@ -286,10 +288,12 @@ EAPI Eina_Bool
ecore_x_e_illume_conformant_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
@@ -484,9 +488,12 @@ EAPI Eina_Bool
ecore_x_e_illume_drag_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG, &val, 1))
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
@@ -505,10 +512,12 @@ EAPI Eina_Bool
ecore_x_e_illume_drag_locked_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
@@ -727,10 +736,12 @@ EAPI Eina_Bool
ecore_x_e_illume_quickpanel_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
@@ -797,12 +808,13 @@ EAPI int
ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR,
- &val, 1))
- return 0;
+ ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
+ return EINA_FALSE;
return val;
}
@@ -821,11 +833,13 @@ EAPI int
ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return 0;
return val;
@@ -845,11 +859,13 @@ EAPI int
ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win)
{
unsigned int val = 0;
+ int ret = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE,
- &val, 1))
+ ret = ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE,
+ &val, 1);
+ if ((ret == 0) || (ret == -1))
return 0;
return val;
@@ -973,12 +989,14 @@ EAPI int
ecore_x_e_illume_sliding_win_state_get(Ecore_X_Window win)
{
unsigned int is_visible = 0;
-
+ int ret = 0;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE,
- &is_visible, 1))
- return 0;
+ ret = ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE,
+ &is_visible, 1);
+ if ((ret == 0) || (ret == -1))
+ return 0;
return is_visible;
}