summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 17:34:20 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 17:34:37 -0500
commitff1a0475c3790042e24050f9adce5950d45ffda9 (patch)
treed9f4c7b302b71103ff09bda7782c125547e2822e /src/lib/ecore_x
parent7c087d209a8564a0fc460edf3924d81100a5212d (diff)
ecore-x: add more null checks for functions
@fix
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/ecore_x.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 3dab2b8..51491f4 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -983,7 +983,7 @@ ecore_x_screen_size_get(const Ecore_X_Screen *screen,
983 LOGFN(__FILE__, __LINE__, __FUNCTION__); 983 LOGFN(__FILE__, __LINE__, __FUNCTION__);
984 if (w) *w = 0; 984 if (w) *w = 0;
985 if (h) *h = 0; 985 if (h) *h = 0;
986 if (!s) return; 986 EINA_SAFETY_ON_NULL_RETURN(screen);
987 if (w) *w = s->width; 987 if (w) *w = s->width;
988 if (h) *h = s->height; 988 if (h) *h = s->height;
989} 989}
@@ -1016,6 +1016,7 @@ ecore_x_screen_count_get(void)
1016EAPI int 1016EAPI int
1017ecore_x_screen_index_get(const Ecore_X_Screen *screen) 1017ecore_x_screen_index_get(const Ecore_X_Screen *screen)
1018{ 1018{
1019 EINA_SAFETY_ON_NULL_RETURN_VAL(screen, -1);
1019 return XScreenNumberOfScreen((Screen *)screen); 1020 return XScreenNumberOfScreen((Screen *)screen);
1020} 1021}
1021 1022
@@ -1870,6 +1871,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win,
1870 int mod, 1871 int mod,
1871 int any_mod) 1872 int any_mod)
1872{ 1873{
1874 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
1873 _ecore_x_window_button_ungrab_internal(win, button, mod, any_mod); 1875 _ecore_x_window_button_ungrab_internal(win, button, mod, any_mod);
1874 _ecore_x_sync_magic_send(1, win, button, mod, any_mod); 1876 _ecore_x_sync_magic_send(1, win, button, mod, any_mod);
1875// _ecore_x_window_grab_remove(win, button, mod, any_mod); 1877// _ecore_x_window_grab_remove(win, button, mod, any_mod);
@@ -1974,6 +1976,7 @@ ecore_x_window_key_grab(Ecore_X_Window win,
1974{ 1976{
1975 Keygrab *t; 1977 Keygrab *t;
1976 1978
1979 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
1977 _ecore_x_window_key_grab_internal(win, key, mod, any_mod); 1980 _ecore_x_window_key_grab_internal(win, key, mod, any_mod);
1978 _ecore_key_grabs_num++; 1981 _ecore_key_grabs_num++;
1979 t = realloc(_ecore_key_grabs, 1982 t = realloc(_ecore_key_grabs,
@@ -2080,6 +2083,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win,
2080 int mod, 2083 int mod,
2081 int any_mod) 2084 int any_mod)
2082{ 2085{
2086 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
2083 _ecore_x_window_key_ungrab_internal(win, key, mod, any_mod); 2087 _ecore_x_window_key_ungrab_internal(win, key, mod, any_mod);
2084 _ecore_x_sync_magic_send(2, win, XStringToKeysym(key), mod, any_mod); 2088 _ecore_x_sync_magic_send(2, win, XStringToKeysym(key), mod, any_mod);
2085// _ecore_x_key_grab_remove(win, key, mod, any_mod); 2089// _ecore_x_key_grab_remove(win, key, mod, any_mod);