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
This commit is contained in:
parent
1cb0c16ff4
commit
de539e218a
4 changed files with 11 additions and 6 deletions
|
@ -563,6 +563,9 @@ void add_entry (char *key, char *value)
|
||||||
systray.saturation = atoi(value2);
|
systray.saturation = atoi(value2);
|
||||||
systray.brightness = atoi(value3);
|
systray.brightness = atoi(value3);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(key, "systray_monitor") == 0) {
|
||||||
|
systray_monitor = atoi(value);
|
||||||
|
}
|
||||||
|
|
||||||
/* Launcher */
|
/* Launcher */
|
||||||
else if (strcmp (key, "launcher_padding") == 0) {
|
else if (strcmp (key, "launcher_padding") == 0) {
|
||||||
|
|
11
src/panel.c
11
src/panel.c
|
@ -182,9 +182,8 @@ 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' && i==0) {
|
if (panel_items_order[k] == 'S' &&
|
||||||
// TODO : check systray is only on 1 panel
|
((i == systray_monitor) || (i == 0 && systray_monitor >= nb_panel))) {
|
||||||
// at the moment only on panel1[0] allowed
|
|
||||||
init_systray_panel(p);
|
init_systray_panel(p);
|
||||||
refresh_systray = 1;
|
refresh_systray = 1;
|
||||||
}
|
}
|
||||||
|
@ -402,9 +401,9 @@ void set_panel_items_order(Panel *p)
|
||||||
if (panel_items_order[k] == 'B')
|
if (panel_items_order[k] == 'B')
|
||||||
p->area.list = g_slist_append(p->area.list, &p->battery);
|
p->area.list = g_slist_append(p->area.list, &p->battery);
|
||||||
#endif
|
#endif
|
||||||
if (panel_items_order[k] == 'S' && p == panel1) {
|
int i = p - panel1;
|
||||||
// TODO : check systray is only on 1 panel
|
if (panel_items_order[k] == 'S' &&
|
||||||
// at the moment only on panel1[0] allowed
|
((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')
|
||||||
|
|
|
@ -49,6 +49,7 @@ Systraybar systray;
|
||||||
int refresh_systray;
|
int refresh_systray;
|
||||||
int systray_enabled;
|
int systray_enabled;
|
||||||
int systray_max_icon_size;
|
int systray_max_icon_size;
|
||||||
|
int systray_monitor;
|
||||||
|
|
||||||
// background pixmap if we render ourselves the icons
|
// background pixmap if we render ourselves the icons
|
||||||
static Pixmap render_background;
|
static Pixmap render_background;
|
||||||
|
@ -71,6 +72,7 @@ void cleanup_systray()
|
||||||
stop_net();
|
stop_net();
|
||||||
systray_enabled = 0;
|
systray_enabled = 0;
|
||||||
systray_max_icon_size = 0;
|
systray_max_icon_size = 0;
|
||||||
|
systray_monitor = 0;
|
||||||
systray.area.on_screen = 0;
|
systray.area.on_screen = 0;
|
||||||
free_area(&systray.area);
|
free_area(&systray.area);
|
||||||
if (render_background) {
|
if (render_background) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ extern Systraybar systray;
|
||||||
extern int refresh_systray;
|
extern int refresh_systray;
|
||||||
extern int systray_enabled;
|
extern int systray_enabled;
|
||||||
extern int systray_max_icon_size;
|
extern int systray_max_icon_size;
|
||||||
|
extern int systray_monitor;
|
||||||
|
|
||||||
// default global data
|
// default global data
|
||||||
void default_systray();
|
void default_systray();
|
||||||
|
|
Loading…
Reference in a new issue