diff --git a/src/config.c b/src/config.c index 7a8c2de..523e671 100644 --- a/src/config.c +++ b/src/config.c @@ -287,6 +287,10 @@ void add_entry (char *key, char *value) 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) { diff --git a/src/panel.c b/src/panel.c index 60dac5d..7226e73 100644 --- a/src/panel.c +++ b/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 @@ void default_panel() 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_items_order(Panel *p) 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); } diff --git a/src/panel.h b/src/panel.h index e0d2f60..118677f 100644 --- a/src/panel.h +++ b/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 }; diff --git a/src/server.c b/src/server.c index ccfef85..7143e91 100644 --- a/src/server.c +++ b/src/server.c @@ -72,6 +72,7 @@ void server_init_atoms () 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); diff --git a/src/server.h b/src/server.h index df210ad..94d2aba 100644 --- a/src/server.h +++ b/src/server.h @@ -57,6 +57,7 @@ typedef struct Global_atom 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;