diff --git a/src/modules/procstats/e_mod_main.c b/src/modules/procstats/e_mod_main.c index 0596a61de..2d58d71a7 100644 --- a/src/modules/procstats/e_mod_main.c +++ b/src/modules/procstats/e_mod_main.c @@ -8,6 +8,8 @@ #define POLL_INTERVAL 2.0 +static Ecore_Event_Handler *_proc_stats_handler_fullscreen = NULL; + static int64_t _mem_total; typedef struct @@ -77,6 +79,28 @@ _memory_total(void) return 1; } +static Eina_Bool +_proc_stats_handler_fullscreen_check_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + Proc_Stats_Client *client; + E_Event_Client *ev; + Eina_List *l; + Proc_Stats_Module *module = _this_module; + + ev = event; + + EINA_LIST_FOREACH(module->clients, l, client) + { + if (client->ec == ev->ec) + { + _proc_stats_client_remove(client); + break; + } + } + + return ECORE_CALLBACK_PASS_ON; +} + static Eina_Bool _proc_stats_client_exists(E_Client *ec) { @@ -505,6 +529,8 @@ e_modapi_init(E_Module *m) //module->sleeper = e_powersave_sleeper_new(); module->poll_interval = POLL_INTERVAL; + _proc_stats_handler_fullscreen = ecore_event_handler_add + (E_EVENT_CLIENT_FULLSCREEN, _proc_stats_handler_fullscreen_check_cb, NULL); _proc_stats_thread_feedback_cb(module, NULL, proc_info_all_children_get()); module->thread = ecore_thread_feedback_run(_proc_stats_thread, @@ -524,6 +550,9 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED) //e_powersave_sleeper_free(module->sleeper); + ecore_event_handler_del(_proc_stats_handler_fullscreen); + _proc_stats_handler_fullscreen = NULL; + EINA_LIST_FREE(module->clients, client) _proc_stats_client_del(client);