fix shelf autohide when mouse moves out of systray from a systrayed icon's menu

SVN revision: 72783
This commit is contained in:
Mike Blumenkrantz 2012-06-25 07:50:08 +00:00
parent 1f771425e4
commit 80d70ec5dd
2 changed files with 24 additions and 2 deletions

View File

@ -1488,6 +1488,16 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event)
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
e_shelf_toggle(es, 1);
}
else if (es->systrayed)
{
int x, y, w, h;
evas_object_geometry_get(es->o_event, &x, &y, &w, &h);
if (!E_INSIDE(ev->x, ev->y, x, y, w, h))
{
es->systrayed = EINA_FALSE;
e_shelf_toggle(es, 0);
}
}
}
else if (type == ECORE_EVENT_MOUSE_MOVE)
{
@ -1515,6 +1525,7 @@ _e_shelf_cb_mouse_out(void *data, int type, void *event)
if (type == ECORE_X_EVENT_MOUSE_OUT)
{
Ecore_X_Event_Mouse_Out *ev;
int x, y, w, h;
ev = event;
@ -1531,9 +1542,19 @@ _e_shelf_cb_mouse_out(void *data, int type, void *event)
* not get mouse out itself, so it will stay visible and
* autohide will fail.
*/
if (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR) return ECORE_CALLBACK_PASS_ON;
if (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)
{
//fprintf(stderr, "SYSTRAYED\n");
es->systrayed = EINA_TRUE;
return ECORE_CALLBACK_PASS_ON;
}
e_shelf_toggle(es, 0);
evas_object_geometry_get(es->o_event, &x, &y, &w, &h);
if (!E_INSIDE(ev->x, ev->y, x, y, w, h))
{
//fprintf(stderr, "EVENT: %d,%d %dx%d || MOUSE: %d,%d\n", x, y, w, h, ev->x, ev->y);
e_shelf_toggle(es, 0);
}
}
return ECORE_CALLBACK_PASS_ON;
}

View File

@ -42,6 +42,7 @@ struct _E_Shelf
unsigned char toggle : 1;
unsigned char edge : 1;
unsigned char urgent_show : 1;
unsigned char systrayed : 1;
unsigned int locked;
};