forked from enlightenment/enlightenment
add client util function for detecting popups, block popups in ibar/tasks
mainly a wayland issue where popup menus would cause the tasks gadget to grow and shrink uncontrollably
This commit is contained in:
parent
402c56e1f2
commit
c53a6efc8d
|
@ -76,6 +76,26 @@ e_client_util_ignored_get(const E_Client *ec)
|
|||
return ec->override || ec->input_only || ec->ignored;
|
||||
}
|
||||
|
||||
static inline Eina_Bool
|
||||
e_client_util_is_popup(const E_Client *ec)
|
||||
{
|
||||
if (!ec) return EINA_FALSE;
|
||||
switch (ec->netwm.type)
|
||||
{
|
||||
case E_WINDOW_TYPE_MENU:
|
||||
case E_WINDOW_TYPE_SPLASH:
|
||||
case E_WINDOW_TYPE_DROPDOWN_MENU:
|
||||
case E_WINDOW_TYPE_POPUP_MENU:
|
||||
case E_WINDOW_TYPE_TOOLTIP:
|
||||
case E_WINDOW_TYPE_NOTIFICATION:
|
||||
case E_WINDOW_TYPE_COMBO:
|
||||
case E_WINDOW_TYPE_DND:
|
||||
return EINA_TRUE;
|
||||
default: break;
|
||||
}
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static inline Eina_Bool
|
||||
e_client_util_desk_visible(const E_Client *ec, const E_Desk *desk)
|
||||
{
|
||||
|
|
|
@ -1299,6 +1299,7 @@ _ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec)
|
|||
int w, h;
|
||||
|
||||
if (ec->netwm.state.skip_taskbar || e_client_util_ignored_get(ec)) return EINA_FALSE;
|
||||
if (e_client_util_is_popup(ec)) return EINA_FALSE;
|
||||
o = ic->menu->o_bg;
|
||||
it = edje_object_add(e_comp->evas);
|
||||
ic->client_objs = eina_list_append(ic->client_objs, it);
|
||||
|
|
|
@ -369,7 +369,8 @@ _tasks_new(Evas *e, E_Zone *zone, const char *id)
|
|||
tasks->horizontal = 1;
|
||||
EINA_LIST_FOREACH(e_comp->clients, l, ec)
|
||||
{
|
||||
if ((!e_client_util_ignored_get(ec)) && (!e_object_is_del(E_OBJECT(ec))))
|
||||
if ((!e_client_util_ignored_get(ec)) && (!e_object_is_del(E_OBJECT(ec))) &&
|
||||
(!e_client_util_is_popup(ec)))
|
||||
tasks->clients = eina_list_append(tasks->clients, ec);
|
||||
}
|
||||
|
||||
|
@ -892,6 +893,8 @@ _tasks_cb_event_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *e
|
|||
Eina_List *l;
|
||||
|
||||
if (e_client_util_ignored_get(ev->ec) || e_object_is_del(E_OBJECT(ev->ec))) return ECORE_CALLBACK_RENEW;
|
||||
if (e_client_util_is_popup(ev->ec)) return ECORE_CALLBACK_RENEW;
|
||||
|
||||
EINA_LIST_FOREACH(tasks_config->tasks, l, tasks)
|
||||
{
|
||||
if ((!tasks->clients) || (!eina_list_data_find(tasks->clients, ev->ec)))
|
||||
|
|
Loading…
Reference in New Issue