Make sure auto-hidden shelves only unhide when you mouse in while on a desktop the shelf is actually present on

SVN revision: 57441
This commit is contained in:
Eric Schuele 2011-03-01 04:48:48 +00:00
parent f8fc5f9f78
commit 09b181a9d5
1 changed files with 28 additions and 0 deletions

View File

@ -28,6 +28,7 @@ static int _e_shelf_gadcon_client_add(void *data, const E_Gadcon_Client_Class *c
static const char * _e_shelf_orient_icon_name_get(E_Shelf *s);
static void _e_shelf_bindings_add(E_Shelf *es);
static void _e_shelf_bindings_del(E_Shelf *es);
static Eina_Bool _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev);
static Eina_List *shelves = NULL;
static Eina_Hash *winid_shelves = NULL;
@ -1360,6 +1361,8 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event)
ev = event;
if (es->zone != ev->zone) return ECORE_CALLBACK_PASS_ON;
if (!_e_shelf_on_current_desk(es, ev)) return ECORE_CALLBACK_PASS_ON;
switch (es->gadcon->orient)
{
case E_GADCON_ORIENT_FLOAT:
@ -1844,3 +1847,28 @@ _e_shelf_bindings_del(E_Shelf *es)
for (edge = E_ZONE_EDGE_LEFT; edge <= E_ZONE_EDGE_BOTTOM_LEFT; edge++)
e_bindings_edge_del(E_BINDING_CONTEXT_ZONE, edge, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
}
static Eina_Bool
_e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev)
{
E_Config_Shelf_Desk *sd;
Eina_List *ll;
int on_current_desk = 0;
int on_all_desks = 1;
EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
{
if (!sd) continue;
on_all_desks = 0;
if ((sd->x == ev->zone->desk_x_current) && (sd->y == ev->zone->desk_y_current))
{
on_current_desk = 1;
break;
}
}
if (!on_all_desks && !on_current_desk)
return EINA_FALSE;
return EINA_TRUE;
}