temporarily show the shelf on urgent windows (ibox)

SVN revision: 39649
This commit is contained in:
Viktor Kojouharov 2009-03-23 12:14:31 +00:00
parent 811f193535
commit fb323cef74
3 changed files with 41 additions and 6 deletions

View File

@ -23,6 +23,7 @@ static int _e_shelf_cb_mouse_out(void *data, int type, void *event);
static int _e_shelf_cb_id_sort(const void *data1, const void *data2);
static int _e_shelf_cb_hide_animator(void *data);
static int _e_shelf_cb_hide_animator_timer(void *data);
static int _e_shelf_cb_hide_urgent_timer(void *data);
static int _e_shelf_cb_instant_hide_timer(void *data);
static void _e_shelf_menu_pre_cb(void *data, E_Menu *m);
@ -292,12 +293,16 @@ e_shelf_toggle(E_Shelf *es, int show)
es->toggle = show;
if (es->locked) return;
es->interrupted = -1;
es->urgent_show = 0;
if ((show) && (es->hidden))
{
es->hidden = 0;
edje_object_signal_emit(es->o_base, "e,state,visible", "e");
if (es->instant_delay >= 0.0)
_e_shelf_cb_instant_hide_timer(es);
{
_e_shelf_cb_instant_hide_timer(es);
es->hide_timer = ecore_timer_add(es->cfg->hide_timeout, _e_shelf_cb_hide_urgent_timer, es);
}
else
{
if (es->hide_timer)
@ -314,6 +319,11 @@ e_shelf_toggle(E_Shelf *es, int show)
edje_object_signal_emit(es->o_base, "e,state,hidden", "e");
if (es->instant_delay >= 0.0)
{
if (es->hide_timer)
{
ecore_timer_del(es->hide_timer);
es->hide_timer = NULL;
}
es->hidden = 1;
if (!es->instant_timer)
es->instant_timer = ecore_timer_add(es->instant_delay, _e_shelf_cb_instant_hide_timer, es);
@ -332,6 +342,13 @@ e_shelf_toggle(E_Shelf *es, int show)
}
}
EAPI void
e_shelf_urgent_show(E_Shelf *es)
{
e_shelf_toggle(es, 1);
es->urgent_show = 1;
}
EAPI void
e_shelf_move(E_Shelf *es, int x, int y)
{
@ -1537,6 +1554,8 @@ _e_shelf_cb_hide_animator(void *data)
es->hide_animator = NULL;
if (es->interrupted > -1)
e_shelf_toggle(es, es->interrupted);
else if (es->urgent_show)
e_shelf_toggle(es, 0);
else
_e_shelf_toggle_border_fix(es);
return 0;
@ -1554,6 +1573,18 @@ _e_shelf_cb_hide_animator_timer(void *data)
return 0;
}
static int
_e_shelf_cb_hide_urgent_timer(void *data)
{
E_Shelf *es;
es = data;
es->hide_timer = NULL;
if (es->urgent_show)
e_shelf_toggle(es, 0);
return 0;
}
static int
_e_shelf_cb_instant_hide_timer(void *data)
{

View File

@ -39,11 +39,12 @@ struct _E_Shelf
float instant_delay;
Ecore_Timer *instant_timer;
Eina_List *handlers;
unsigned char fit_along : 1;
unsigned char fit_size : 1;
unsigned char hidden : 1;
unsigned char toggle : 1;
unsigned char edge : 1;
unsigned char fit_along : 1;
unsigned char fit_size : 1;
unsigned char hidden : 1;
unsigned char toggle : 1;
unsigned char edge : 1;
unsigned char urgent_show : 1;
unsigned int locked;
};
@ -58,6 +59,7 @@ EAPI void e_shelf_show(E_Shelf *es);
EAPI void e_shelf_hide(E_Shelf *es);
EAPI void e_shelf_locked_set(E_Shelf *es, int lock);
EAPI void e_shelf_toggle(E_Shelf *es, int show);
EAPI void e_shelf_urgent_show(E_Shelf *es);
EAPI void e_shelf_move(E_Shelf *es, int x, int y);
EAPI void e_shelf_resize(E_Shelf *es, int w, int h);
EAPI void e_shelf_move_resize(E_Shelf *es, int x, int y, int w, int h);

View File

@ -1199,6 +1199,8 @@ _ibox_cb_event_border_urgent_change(void *data, int type, void *event)
if (!ic) continue;
if (ev->border->client.icccm.urgent)
{
if (b->inst->gcc->gadcon->shelf)
e_shelf_urgent_show(b->inst->gcc->gadcon->shelf);
edje_object_signal_emit(ic->o_holder, "e,state,urgent", "e");
edje_object_signal_emit(ic->o_holder2, "e,state,urgent", "e");
}