Better handling of the systray_monitor option
git-svn-id: http://tint2.googlecode.com/svn/trunk@678 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
5a789c2d7f
commit
b70e6b500e
3 changed files with 9 additions and 5 deletions
|
@ -184,8 +184,7 @@ void init_panel()
|
||||||
if (panel_items_order[k] == 'B')
|
if (panel_items_order[k] == 'B')
|
||||||
init_battery_panel(p);
|
init_battery_panel(p);
|
||||||
#endif
|
#endif
|
||||||
if (panel_items_order[k] == 'S' &&
|
if (panel_items_order[k] == 'S' && systray_on_monitor(i, nb_panel)) {
|
||||||
((i == systray_monitor) || (i == 0 && systray_monitor >= nb_panel))) {
|
|
||||||
init_systray_panel(p);
|
init_systray_panel(p);
|
||||||
refresh_systray = 1;
|
refresh_systray = 1;
|
||||||
}
|
}
|
||||||
|
@ -487,8 +486,7 @@ void set_panel_items_order(Panel *p)
|
||||||
p->area.list = g_slist_append(p->area.list, &p->battery);
|
p->area.list = g_slist_append(p->area.list, &p->battery);
|
||||||
#endif
|
#endif
|
||||||
int i = p - panel1;
|
int i = p - panel1;
|
||||||
if (panel_items_order[k] == 'S' &&
|
if (panel_items_order[k] == 'S' && systray_on_monitor(i, nb_panel)) {
|
||||||
((i == systray_monitor) || (i == 0 && systray_monitor >= nb_panel))) {
|
|
||||||
p->area.list = g_slist_append(p->area.list, &systray);
|
p->area.list = g_slist_append(p->area.list, &systray);
|
||||||
}
|
}
|
||||||
if (panel_items_order[k] == 'C')
|
if (panel_items_order[k] == 'C')
|
||||||
|
|
|
@ -636,3 +636,9 @@ void refresh_systray_icon()
|
||||||
systray_render_icon(traywin);
|
systray_render_icon(traywin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int systray_on_monitor(int i_monitor, int nb_panels)
|
||||||
|
{
|
||||||
|
return (i_monitor == systray_monitor) ||
|
||||||
|
(i_monitor == 0 && (systray_monitor >= nb_panels || systray_monitor < 0));
|
||||||
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ void init_systray_panel(void *p);
|
||||||
void draw_systray(void *obj, cairo_t *c);
|
void draw_systray(void *obj, cairo_t *c);
|
||||||
int resize_systray(void *obj);
|
int resize_systray(void *obj);
|
||||||
void on_change_systray(void *obj);
|
void on_change_systray(void *obj);
|
||||||
|
int systray_on_monitor(int i_monitor, int nb_panels);
|
||||||
|
|
||||||
// systray protocol
|
// systray protocol
|
||||||
// many tray icon doesn't manage stop/restart of the systray manager
|
// many tray icon doesn't manage stop/restart of the systray manager
|
||||||
|
|
Loading…
Reference in a new issue