diff --git a/src/config.c b/src/config.c index bf86b10..31b0759 100644 --- a/src/config.c +++ b/src/config.c @@ -563,6 +563,9 @@ void add_entry (char *key, char *value) systray.saturation = atoi(value2); systray.brightness = atoi(value3); } + else if (strcmp(key, "systray_monitor") == 0) { + systray_monitor = atoi(value); + } /* Launcher */ else if (strcmp (key, "launcher_padding") == 0) { diff --git a/src/panel.c b/src/panel.c index 68241c4..7af2a08 100644 --- a/src/panel.c +++ b/src/panel.c @@ -182,9 +182,8 @@ void init_panel() if (panel_items_order[k] == 'B') init_battery_panel(p); #endif - if (panel_items_order[k] == 'S' && i==0) { - // TODO : check systray is only on 1 panel - // at the moment only on panel1[0] allowed + if (panel_items_order[k] == 'S' && + ((i == systray_monitor) || (i == 0 && systray_monitor >= nb_panel))) { init_systray_panel(p); refresh_systray = 1; } @@ -402,9 +401,9 @@ void set_panel_items_order(Panel *p) if (panel_items_order[k] == 'B') p->area.list = g_slist_append(p->area.list, &p->battery); #endif - if (panel_items_order[k] == 'S' && p == panel1) { - // TODO : check systray is only on 1 panel - // at the moment only on panel1[0] allowed + int i = p - panel1; + if (panel_items_order[k] == 'S' && + ((i == systray_monitor) || (i == 0 && systray_monitor >= nb_panel))) { p->area.list = g_slist_append(p->area.list, &systray); } if (panel_items_order[k] == 'C') diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c index 7d15d6d..6f40627 100644 --- a/src/systray/systraybar.c +++ b/src/systray/systraybar.c @@ -49,6 +49,7 @@ Systraybar systray; int refresh_systray; int systray_enabled; int systray_max_icon_size; +int systray_monitor; // background pixmap if we render ourselves the icons static Pixmap render_background; @@ -71,6 +72,7 @@ void cleanup_systray() stop_net(); systray_enabled = 0; systray_max_icon_size = 0; + systray_monitor = 0; systray.area.on_screen = 0; free_area(&systray.area); if (render_background) { diff --git a/src/systray/systraybar.h b/src/systray/systraybar.h index d3f5a72..ee0a385 100644 --- a/src/systray/systraybar.h +++ b/src/systray/systraybar.h @@ -52,6 +52,7 @@ extern Systraybar systray; extern int refresh_systray; extern int systray_enabled; extern int systray_max_icon_size; +extern int systray_monitor; // default global data void default_systray();