diff options
Diffstat (limited to 'src/bin/e_stolen.c')
-rw-r--r-- | src/bin/e_stolen.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/bin/e_stolen.c b/src/bin/e_stolen.c index 7b6614e11c..e7740df222 100644 --- a/src/bin/e_stolen.c +++ b/src/bin/e_stolen.c @@ -11,15 +11,15 @@ struct _E_Stolen_Window int refcount; }; -static Evas_Hash *_e_stolen_windows = NULL; +static Eina_Hash *_e_stolen_windows = NULL; /* externally accessible functions */ EAPI int e_stolen_win_get(Ecore_X_Window win) { E_Stolen_Window *esw; - - esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); + + esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); if (esw) return 1; return 0; } @@ -28,8 +28,8 @@ EAPI void e_stolen_win_add(Ecore_X_Window win) { E_Stolen_Window *esw; - - esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); + + esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); if (esw) { esw->refcount++; @@ -39,7 +39,8 @@ e_stolen_win_add(Ecore_X_Window win) esw = E_NEW(E_Stolen_Window, 1); esw->win = win; esw->refcount = 1; - _e_stolen_windows = evas_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw); + if (!_e_stolen_windows) _e_stolen_windows = eina_hash_string_superfast_new(NULL); + eina_hash_add(_e_stolen_windows, e_util_winid_str_get(win), esw); } return; } @@ -48,14 +49,19 @@ EAPI void e_stolen_win_del(Ecore_X_Window win) { E_Stolen_Window *esw; - - esw = evas_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); + + esw = eina_hash_find(_e_stolen_windows, e_util_winid_str_get(win)); if (esw) { esw->refcount--; if (esw->refcount == 0) { - _e_stolen_windows = evas_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw); + eina_hash_del(_e_stolen_windows, e_util_winid_str_get(win), esw); + if (!eina_hash_population(_e_stolen_windows)) + { + eina_hash_free(_e_stolen_windows); + _e_stolen_windows = NULL; + } free(esw); } } |