Luncher: Add a timeout for mousing out when preview already exists. Update preview on deskswitch.
This fixes https://phab.enlightenment.org/T6328 and https://phab.enlightenment.org/T6202
This commit is contained in:
parent
d24055e361
commit
6d6582e889
|
@ -470,7 +470,7 @@ _bar_icon_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *eve
|
||||||
elm_object_tooltip_hide(obj);
|
elm_object_tooltip_hide(obj);
|
||||||
E_FREE_FUNC(ic->mouse_in_timer, ecore_timer_del);
|
E_FREE_FUNC(ic->mouse_in_timer, ecore_timer_del);
|
||||||
E_FREE_FUNC(ic->mouse_out_timer, ecore_timer_del);
|
E_FREE_FUNC(ic->mouse_out_timer, ecore_timer_del);
|
||||||
ic->mouse_out_timer = ecore_timer_loop_add(0.25, _bar_icon_preview_hide, ic);
|
ic->mouse_out_timer = ecore_timer_loop_add(.25, _bar_icon_preview_hide, ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -928,10 +928,11 @@ _bar_icon_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *even
|
||||||
}
|
}
|
||||||
E_FREE_FUNC(ic->mouse_out_timer, ecore_timer_del);
|
E_FREE_FUNC(ic->mouse_out_timer, ecore_timer_del);
|
||||||
E_FREE_FUNC(ic->mouse_in_timer, ecore_timer_del);
|
E_FREE_FUNC(ic->mouse_in_timer, ecore_timer_del);
|
||||||
|
if (ic->inst->current_preview && (ic->preview == ic->inst->current_preview)) return;
|
||||||
if (eina_list_count(ic->execs) || eina_list_count(ic->clients))
|
if (eina_list_count(ic->execs) || eina_list_count(ic->clients))
|
||||||
clients = EINA_TRUE;
|
clients = EINA_TRUE;
|
||||||
if (clients && ic->inst->current_preview && !ic->inst->current_preview_menu)
|
if (clients && ic->inst->current_preview && !ic->inst->current_preview_menu)
|
||||||
_bar_icon_preview_show(ic);
|
ic->mouse_in_timer = ecore_timer_loop_add(0.2, _bar_icon_preview_show, ic);
|
||||||
else if (clients && !ic->inst->current_preview)
|
else if (clients && !ic->inst->current_preview)
|
||||||
ic->mouse_in_timer = ecore_timer_loop_add(0.3, _bar_icon_preview_show, ic);
|
ic->mouse_in_timer = ecore_timer_loop_add(0.3, _bar_icon_preview_show, ic);
|
||||||
}
|
}
|
||||||
|
@ -1176,6 +1177,31 @@ _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client *non_desktop_cli
|
||||||
return ic;
|
return ic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_bar_cb_desk_switch(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Client *ev EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Instance *inst = NULL;
|
||||||
|
Icon *ic = NULL;
|
||||||
|
Eina_List *l = NULL, *ll = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(luncher_instances, l, inst)
|
||||||
|
{
|
||||||
|
if (inst->current_preview)
|
||||||
|
{
|
||||||
|
EINA_LIST_FOREACH(inst->icons, ll, ic)
|
||||||
|
{
|
||||||
|
if (inst->current_preview && (inst->current_preview == ic->preview))
|
||||||
|
{
|
||||||
|
_bar_icon_preview_show(ic);
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ECORE_CALLBACK_RENEW;
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_bar_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Client *ev)
|
_bar_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Client *ev)
|
||||||
{
|
{
|
||||||
|
@ -2055,6 +2081,8 @@ bar_create(Evas_Object *parent, int *id, E_Gadget_Site_Orient orient EINA_UNUSED
|
||||||
_bar_cb_exec_del, NULL);
|
_bar_cb_exec_del, NULL);
|
||||||
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE,
|
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE,
|
||||||
_bar_cb_client_remove, NULL);
|
_bar_cb_client_remove, NULL);
|
||||||
|
E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_SHOW,
|
||||||
|
_bar_cb_desk_switch, NULL);
|
||||||
}
|
}
|
||||||
if (inst->cfg->id < 0) return inst->o_main;
|
if (inst->cfg->id < 0) return inst->o_main;
|
||||||
luncher_instances = eina_list_append(luncher_instances, inst);
|
luncher_instances = eina_list_append(luncher_instances, inst);
|
||||||
|
|
Loading…
Reference in New Issue