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.brightness = atoi(value3);
|
||||
}
|
||||
else if (strcmp(key, "systray_monitor") == 0) {
|
||||
systray_monitor = atoi(value);
|
||||
}
|
||||
|
||||
/* Launcher */
|
||||
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')
|
||||
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')
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue