Merge branch 'master' into 'master'
Add systray_hide_by_icon_name Exact Match, Deliminator ',' See merge request !24
This commit is contained in:
@@ -1009,6 +1009,8 @@ void add_entry(char *key, char *value)
|
||||
systray.brightness = atoi(value3);
|
||||
} else if (strcmp(key, "systray_monitor") == 0) {
|
||||
systray_monitor = atoi(value) - 1;
|
||||
} else if (strcmp(key, "systray_hide_by_icon_name") == 0) {
|
||||
strcpy(systray_hide_icons, value);
|
||||
}
|
||||
|
||||
/* Launcher */
|
||||
|
||||
@@ -54,6 +54,7 @@ int systray_monitor;
|
||||
int chrono;
|
||||
int systray_composited;
|
||||
int systray_profile;
|
||||
char systray_hide_icons[100];
|
||||
// background pixmap if we render ourselves the icons
|
||||
static Pixmap render_background;
|
||||
|
||||
@@ -583,6 +584,22 @@ gboolean add_icon(Window win)
|
||||
}
|
||||
}
|
||||
|
||||
char *name = get_window_name(win);
|
||||
|
||||
// Filter out systray_hide_by_icon_name
|
||||
char *token;
|
||||
char *string;
|
||||
string = strdup(systray_hide_icons);
|
||||
if (string != NULL && string[0] != '0') {
|
||||
while ((token = strsep(&string, ",")) != NULL) {
|
||||
if (strcmp(token,name) == 0) {
|
||||
if (strcmp(token,"") == 0) token = "empty name";
|
||||
fprintf(stderr, GREEN "filtering out '%s'\n", token);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dangerous actions begin
|
||||
XSync(server.display, False);
|
||||
error = FALSE;
|
||||
@@ -590,7 +607,6 @@ gboolean add_icon(Window win)
|
||||
|
||||
XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
|
||||
|
||||
char *name = get_window_name(win);
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name);
|
||||
Panel *panel = systray.area.panel;
|
||||
|
||||
@@ -75,6 +75,7 @@ extern gboolean systray_enabled;
|
||||
extern int systray_max_icon_size;
|
||||
extern int systray_monitor;
|
||||
extern gboolean systray_profile;
|
||||
extern char systray_hide_icons[100];
|
||||
|
||||
// default global data
|
||||
void default_systray();
|
||||
|
||||
Reference in New Issue
Block a user