optimize case where an x11 client is focused/unfocused in same loop iteration

This commit is contained in:
Mike Blumenkrantz 2016-03-31 11:20:19 -04:00
parent 4a73e9f29a
commit 9c3d8aa9ca
1 changed files with 10 additions and 0 deletions

View File

@ -4503,6 +4503,11 @@ _e_comp_x_hook_client_focus_unset_job(void *d EINA_UNUSED)
static void
_e_comp_x_hook_client_focus_unset(void *d EINA_UNUSED, E_Client *ec)
{
if (focus_job_client == ec)
{
focus_job_client = NULL;
E_FREE_FUNC(focus_job, ecore_job_del);
}
unfocus_job_client = ec;
if (!unfocus_job)
unfocus_job = ecore_job_add(_e_comp_x_hook_client_focus_unset_job, NULL);
@ -4542,6 +4547,11 @@ _e_comp_x_hook_client_focus_set_job(void *d EINA_UNUSED)
static void
_e_comp_x_hook_client_focus_set(void *d EINA_UNUSED, E_Client *ec)
{
if (unfocus_job_client == ec)
{
unfocus_job_client = NULL;
E_FREE_FUNC(unfocus_job, ecore_job_del);
}
focus_job_client = ec;
if (!focus_job)
focus_job = ecore_job_add(_e_comp_x_hook_client_focus_set_job, NULL);