Merge branch 'master' into 'master'

Add systray_hide_by_icon_name Exact Match, Deliminator ','

See merge request !24
This commit is contained in:
o9000
2017-03-04 14:26:23 +00:00
3 changed files with 20 additions and 1 deletions

View File

@@ -1009,6 +1009,8 @@ void add_entry(char *key, char *value)
systray.brightness = atoi(value3); systray.brightness = atoi(value3);
} else if (strcmp(key, "systray_monitor") == 0) { } else if (strcmp(key, "systray_monitor") == 0) {
systray_monitor = atoi(value) - 1; systray_monitor = atoi(value) - 1;
} else if (strcmp(key, "systray_hide_by_icon_name") == 0) {
strcpy(systray_hide_icons, value);
} }
/* Launcher */ /* Launcher */

View File

@@ -54,6 +54,7 @@ int systray_monitor;
int chrono; int chrono;
int systray_composited; int systray_composited;
int systray_profile; int systray_profile;
char systray_hide_icons[100];
// background pixmap if we render ourselves the icons // background pixmap if we render ourselves the icons
static Pixmap render_background; 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 // Dangerous actions begin
XSync(server.display, False); XSync(server.display, False);
error = FALSE; error = FALSE;
@@ -590,7 +607,6 @@ gboolean add_icon(Window win)
XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); XSelectInput(server.display, win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask);
char *name = get_window_name(win);
if (systray_profile) if (systray_profile)
fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name); fprintf(stderr, "[%f] %s:%d win = %lu (%s)\n", profiling_get_time(), __FUNCTION__, __LINE__, win, name);
Panel *panel = systray.area.panel; Panel *panel = systray.area.panel;

View File

@@ -75,6 +75,7 @@ extern gboolean systray_enabled;
extern int systray_max_icon_size; extern int systray_max_icon_size;
extern int systray_monitor; extern int systray_monitor;
extern gboolean systray_profile; extern gboolean systray_profile;
extern char systray_hide_icons[100];
// default global data // default global data
void default_systray(); void default_systray();