summaryrefslogtreecommitdiff
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
parentc5b3956cc3415d8a0bed48fb7dcb21eae01bc8c2 (diff)
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 9ddd455..a772e50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-12-02 Daniel Juyung Seo (SeoZ)
2
3 * Check ecore_x_window_prop_card32_get() return value correctly in ecore_x_e.
4
12013-12-01 Carsten Haitzler (The Rasterman) 52013-12-01 Carsten Haitzler (The Rasterman)
2 6
3 * 1.8 release 7 * 1.8 release
diff --git a/NEWS b/NEWS
index 63e87da..f662b75 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Improvements:
11 11
12Fixes: 12Fixes:
13 13
14 * Check ecore_x_window_prop_card32_get() return value correctly in ecore_x_e.
15
14Removals: 16Removals:
15 17
16 18
diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c
index 64c9944..be9f7f4 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
55ecore_x_e_virtual_keyboard_get(Ecore_X_Window win) 55ecore_x_e_virtual_keyboard_get(Ecore_X_Window win)
56{ 56{
57 unsigned int val = 0; 57 unsigned int val = 0;
58 int ret = 0;
58 59
59 LOGFN(__FILE__, __LINE__, __FUNCTION__); 60 LOGFN(__FILE__, __LINE__, __FUNCTION__);
60 if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD, 61 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
61 &val, 1)) 62 &val, 1);
63 if ((ret == 0) || (ret == -1))
62 return EINA_FALSE; 64 return EINA_FALSE;
63 65
64 return val ? EINA_TRUE : EINA_FALSE; 66 return val ? EINA_TRUE : EINA_FALSE;
@@ -286,10 +288,12 @@ EAPI Eina_Bool
286ecore_x_e_illume_conformant_get(Ecore_X_Window win) 288ecore_x_e_illume_conformant_get(Ecore_X_Window win)
287{ 289{
288 unsigned int val = 0; 290 unsigned int val = 0;
291 int ret = 0;
289 292
290 LOGFN(__FILE__, __LINE__, __FUNCTION__); 293 LOGFN(__FILE__, __LINE__, __FUNCTION__);
291 if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT, 294 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
292 &val, 1)) 295 &val, 1);
296 if ((ret == 0) || (ret == -1))
293 return EINA_FALSE; 297 return EINA_FALSE;
294 298
295 return val ? EINA_TRUE : EINA_FALSE; 299 return val ? EINA_TRUE : EINA_FALSE;
@@ -484,9 +488,12 @@ EAPI Eina_Bool
484ecore_x_e_illume_drag_get(Ecore_X_Window win) 488ecore_x_e_illume_drag_get(Ecore_X_Window win)
485{ 489{
486 unsigned int val = 0; 490 unsigned int val = 0;
491 int ret = 0;
487 492
488 LOGFN(__FILE__, __LINE__, __FUNCTION__); 493 LOGFN(__FILE__, __LINE__, __FUNCTION__);
489 if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG, &val, 1)) 494 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG,
495 &val, 1);
496 if ((ret == 0) || (ret == -1))
490 return EINA_FALSE; 497 return EINA_FALSE;
491 498
492 return val ? EINA_TRUE : EINA_FALSE; 499 return val ? EINA_TRUE : EINA_FALSE;
@@ -505,10 +512,12 @@ EAPI Eina_Bool
505ecore_x_e_illume_drag_locked_get(Ecore_X_Window win) 512ecore_x_e_illume_drag_locked_get(Ecore_X_Window win)
506{ 513{
507 unsigned int val = 0; 514 unsigned int val = 0;
515 int ret = 0;
508 516
509 LOGFN(__FILE__, __LINE__, __FUNCTION__); 517 LOGFN(__FILE__, __LINE__, __FUNCTION__);
510 if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED, 518 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
511 &val, 1)) 519 &val, 1);
520 if ((ret == 0) || (ret == -1))
512 return EINA_FALSE; 521 return EINA_FALSE;
513 522
514 return val ? EINA_TRUE : EINA_FALSE; 523 return val ? EINA_TRUE : EINA_FALSE;
@@ -727,10 +736,12 @@ EAPI Eina_Bool
727ecore_x_e_illume_quickpanel_get(Ecore_X_Window win) 736ecore_x_e_illume_quickpanel_get(Ecore_X_Window win)
728{ 737{
729 unsigned int val = 0; 738 unsigned int val = 0;
739 int ret = 0;
730 740
731 LOGFN(__FILE__, __LINE__, __FUNCTION__); 741 LOGFN(__FILE__, __LINE__, __FUNCTION__);
732 if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL, 742 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
733 &val, 1)) 743 &val, 1);
744 if ((ret == 0) || (ret == -1))
734 return EINA_FALSE; 745 return EINA_FALSE;
735 746
736 return val ? EINA_TRUE : EINA_FALSE; 747 return val ? EINA_TRUE : EINA_FALSE;
@@ -797,12 +808,13 @@ EAPI int
797ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win) 808ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win)
798{ 809{
799 unsigned int val = 0; 810 unsigned int val = 0;
811 int ret = 0;
800 812
801 LOGFN(__FILE__, __LINE__, __FUNCTION__); 813 LOGFN(__FILE__, __LINE__, __FUNCTION__);
802 if (!ecore_x_window_prop_card32_get(win, 814 ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR,
803 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR, 815 &val, 1);
804 &val, 1)) 816 if ((ret == 0) || (ret == -1))
805 return 0; 817 return EINA_FALSE;
806 818
807 return val; 819 return val;
808} 820}
@@ -821,11 +833,13 @@ EAPI int
821ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win) 833ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
822{ 834{
823 unsigned int val = 0; 835 unsigned int val = 0;
836 int ret = 0;
824 837
825 LOGFN(__FILE__, __LINE__, __FUNCTION__); 838 LOGFN(__FILE__, __LINE__, __FUNCTION__);
826 if (!ecore_x_window_prop_card32_get(win, 839 ret = ecore_x_window_prop_card32_get(win,
827 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR, 840 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR,
828 &val, 1)) 841 &val, 1);
842 if ((ret == 0) || (ret == -1))
829 return 0; 843 return 0;
830 844
831 return val; 845 return val;
@@ -845,11 +859,13 @@ EAPI int
845ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win) 859ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win)
846{ 860{
847 unsigned int val = 0; 861 unsigned int val = 0;
862 int ret = 0;
848 863
849 LOGFN(__FILE__, __LINE__, __FUNCTION__); 864 LOGFN(__FILE__, __LINE__, __FUNCTION__);
850 if (!ecore_x_window_prop_card32_get(win, 865 ret = ecore_x_window_prop_card32_get(win,
851 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE, 866 ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE,
852 &val, 1)) 867 &val, 1);
868 if ((ret == 0) || (ret == -1))
853 return 0; 869 return 0;
854 870
855 return val; 871 return val;
@@ -973,12 +989,14 @@ EAPI int
973ecore_x_e_illume_sliding_win_state_get(Ecore_X_Window win) 989ecore_x_e_illume_sliding_win_state_get(Ecore_X_Window win)
974{ 990{
975 unsigned int is_visible = 0; 991 unsigned int is_visible = 0;
976 992 int ret = 0;
993
977 LOGFN(__FILE__, __LINE__, __FUNCTION__); 994 LOGFN(__FILE__, __LINE__, __FUNCTION__);
978 if (!ecore_x_window_prop_card32_get(win, 995 ret = ecore_x_window_prop_card32_get(win,
979 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE, 996 ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE,
980 &is_visible, 1)) 997 &is_visible, 1);
981 return 0; 998 if ((ret == 0) || (ret == -1))
999 return 0;
982 1000
983 return is_visible; 1001 return is_visible;
984} 1002}