Systray: option to configure monitor (fixes issue 451 and TODOs in the code) git-svn-id: http://tint2.googlecode.com/svn/trunk@667 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
o9000 o9000
4 files changed,
11 insertions(+),
6 deletions(-)
M
src/config.c
→
src/config.c
@@ -563,6 +563,9 @@ systray.alpha = atoi(value1);
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) {
M
src/panel.c
→
src/panel.c
@@ -182,9 +182,8 @@ #ifdef ENABLE_BATTERY
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 @@ #ifdef ENABLE_BATTERY
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')
M
src/systray/systraybar.c
→
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 @@ {
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) {
M
src/systray/systraybar.h
→
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();