procstats: Handle e_client fullscreen requests.

Add an event handler for E_CLIENT_FULLSCREEN. Remove the client,
destroying the popup and icon region.

This resolves the issue where a client fullscreen request would
leave a rogue icon region and popup if switching to full screen
with some applications.

@fix T8996
This commit is contained in:
Alastair Poole 2022-04-25 15:21:19 +01:00
parent e4768d53f0
commit b413ee5d03
1 changed files with 29 additions and 0 deletions

View File

@ -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);