forked from enlightenment/enlightenment
systray: fix bad icon placement.
Some icons will change their geometry and this should be reflected on layout. This should fix some icons being incorrectly placed (Google Desktop, VideoLan, Claws-Mail, ...) By: Vincent Francois SVN revision: 41308
This commit is contained in:
parent
fcd149d896
commit
df098aa052
|
@ -79,6 +79,7 @@ struct _Instance
|
||||||
Ecore_Event_Handler *show;
|
Ecore_Event_Handler *show;
|
||||||
Ecore_Event_Handler *reparent;
|
Ecore_Event_Handler *reparent;
|
||||||
Ecore_Event_Handler *sel_clear;
|
Ecore_Event_Handler *sel_clear;
|
||||||
|
Ecore_Event_Handler *configure;
|
||||||
} handler;
|
} handler;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -743,6 +744,24 @@ _systray_cb_window_show(void *data, int type __UNUSED__, void *event)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_systray_cb_window_configure(void *data, int type __UNUSED__, void *event)
|
||||||
|
{
|
||||||
|
Ecore_X_Event_Window_Configure *ev = event;
|
||||||
|
Instance *inst = data;
|
||||||
|
Icon *icon;
|
||||||
|
const Eina_List *l;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(inst->icons, l, icon)
|
||||||
|
if (icon->win == ev->win)
|
||||||
|
{
|
||||||
|
_systray_icon_geometry_apply(icon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_systray_cb_reparent_notify(void *data, int type __UNUSED__, void *event)
|
_systray_cb_reparent_notify(void *data, int type __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
|
@ -932,6 +951,8 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
||||||
(ECORE_X_EVENT_WINDOW_REPARENT, _systray_cb_reparent_notify, inst);
|
(ECORE_X_EVENT_WINDOW_REPARENT, _systray_cb_reparent_notify, inst);
|
||||||
inst->handler.sel_clear = ecore_event_handler_add
|
inst->handler.sel_clear = ecore_event_handler_add
|
||||||
(ECORE_X_EVENT_SELECTION_CLEAR, _systray_cb_selection_clear, inst);
|
(ECORE_X_EVENT_SELECTION_CLEAR, _systray_cb_selection_clear, inst);
|
||||||
|
inst->handler.configure = ecore_event_handler_add
|
||||||
|
(ECORE_X_EVENT_WINDOW_CONFIGURE, _systray_cb_window_configure, inst);
|
||||||
|
|
||||||
instance = inst;
|
instance = inst;
|
||||||
return inst->gcc;
|
return inst->gcc;
|
||||||
|
@ -967,6 +988,8 @@ _gc_shutdown(E_Gadcon_Client *gcc)
|
||||||
ecore_event_handler_del(inst->handler.reparent);
|
ecore_event_handler_del(inst->handler.reparent);
|
||||||
if (inst->handler.sel_clear)
|
if (inst->handler.sel_clear)
|
||||||
ecore_event_handler_del(inst->handler.sel_clear);
|
ecore_event_handler_del(inst->handler.sel_clear);
|
||||||
|
if (inst->handler.configure)
|
||||||
|
ecore_event_handler_del(inst->handler.configure);
|
||||||
if (inst->timer.retry)
|
if (inst->timer.retry)
|
||||||
ecore_timer_del(inst->timer.retry);
|
ecore_timer_del(inst->timer.retry);
|
||||||
if (inst->idler.size_apply)
|
if (inst->idler.size_apply)
|
||||||
|
|
Loading…
Reference in New Issue