Add new configuration parameter panel_window_name to set WM_NAME (and WM_ICON_NAME) to identify multiple instances of tint2. (Issue 460). git-svn-id: http://tint2.googlecode.com/svn/trunk@690 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
google@craigoakes.com google@craigoakes.com@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
5 files changed,
13 insertions(+),
2 deletions(-)
M
src/config.c
→
src/config.c
@@ -287,6 +287,10 @@ }
else if (strcmp (key, "disable_transparency") == 0) { server.disable_transparency = atoi (value); } + else if (strcmp (key, "panel_window_name") == 0) { + if (strlen(value) > 0) + panel_window_name = strdup (value); + } /* Battery */ else if (strcmp (key, "battery_low_status") == 0) {
M
src/panel.c
→
src/panel.c
@@ -53,6 +53,7 @@ int panel_position;
int panel_horizontal; int panel_refresh; int task_dragged; +char *panel_window_name; int panel_autohide; int panel_autohide_show_timeout;@@ -89,6 +90,7 @@ panel_autohide_height = 5; // for vertical panels this is of course the width
panel_strut_policy = STRUT_FOLLOW_SIZE; panel_dock = 0; // default not in the dock panel_layer = BOTTOM_LAYER; // default is bottom layer + panel_window_name = "tint2"; wm_menu = 0; max_tick_urgent = 14; mouse_left = TOGGLE_ICONIFY;@@ -498,12 +500,14 @@
void set_panel_properties(Panel *p) { - XStoreName (server.dsp, p->main_win, "tint2"); + XStoreName (server.dsp, p->main_win, panel_window_name); + XSetIconName (server.dsp, p->main_win, panel_window_name); gsize len; - gchar *name = g_locale_to_utf8("tint2", -1, NULL, &len, NULL); + gchar *name = g_locale_to_utf8(panel_window_name, -1, NULL, &len, NULL); if (name != NULL) { XChangeProperty(server.dsp, p->main_win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 8, PropModeReplace, (unsigned char *) name, (int) len); + XChangeProperty(server.dsp, p->main_win, server.atom._NET_WM_ICON_NAME, server.atom.UTF8_STRING, 8, PropModeReplace, (unsigned char *) name, (int) len); g_free(name); }
M
src/panel.h
→
src/panel.h
@@ -44,6 +44,7 @@ extern int panel_mode;
extern int wm_menu; extern int panel_dock; extern int panel_layer; +extern char *panel_window_name; //panel position enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
M
src/server.c
→
src/server.c
@@ -72,6 +72,7 @@ server.atom._NET_WM_NAME = XInternAtom (server.dsp, "_NET_WM_NAME", False);
server.atom._NET_WM_STRUT = XInternAtom (server.dsp, "_NET_WM_STRUT", False); server.atom._NET_WM_ICON = XInternAtom (server.dsp, "_NET_WM_ICON", False); server.atom._NET_WM_ICON_GEOMETRY = XInternAtom(server.dsp, "_NET_WM_ICON_GEOMETRY", False ); + server.atom._NET_WM_ICON_NAME = XInternAtom(server.dsp, "_NET_WM_ICON_NAME", False ); server.atom._NET_CLOSE_WINDOW = XInternAtom (server.dsp, "_NET_CLOSE_WINDOW", False); server.atom.UTF8_STRING = XInternAtom (server.dsp, "UTF8_STRING", False); server.atom._NET_SUPPORTING_WM_CHECK = XInternAtom (server.dsp, "_NET_SUPPORTING_WM_CHECK", False);
M
src/server.h
→
src/server.h
@@ -57,6 +57,7 @@ Atom _NET_WM_VISIBLE_NAME;
Atom _NET_WM_STRUT; Atom _NET_WM_ICON; Atom _NET_WM_ICON_GEOMETRY; + Atom _NET_WM_ICON_NAME; Atom _NET_CLOSE_WINDOW; Atom UTF8_STRING; Atom _NET_SUPPORTING_WM_CHECK;