diff options
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -171,6 +171,8 @@ void win_init(win_t *win) INIT_ATOM_(_NET_WM_PID); INIT_ATOM_(_NET_WM_STATE_FULLSCREEN); INIT_ATOM_(UTF8_STRING); + INIT_ATOM_(WM_NAME); + INIT_ATOM_(WM_ICON_NAME); } void win_open(win_t *win) @@ -289,10 +291,7 @@ void win_open(win_t *win) } free(icon_data); - XStoreName(win->env.dpy, win->xwin, res_name); - XSetIconName(win->env.dpy, win->xwin, res_name); win_set_title(win, true); - classhint.res_class = res_class; classhint.res_name = options->res_name != NULL ? options->res_name : res_name; XSetClassHint(e->dpy, win->xwin, &classhint); @@ -505,16 +504,16 @@ void win_draw_rect(win_t *win, int x, int y, int w, int h, bool fill, int lw, void win_set_title(win_t *win, bool init) { + size_t len, i; unsigned char title[512]; - size_t len; - - if ((len = get_win_title(title, ARRLEN(title), init)) <= 0) - return; + int targets[] = { ATOM_WM_NAME, ATOM_WM_ICON_NAME, ATOM__NET_WM_NAME, ATOM__NET_WM_ICON_NAME }; - XChangeProperty(win->env.dpy, win->xwin, atoms[ATOM__NET_WM_NAME], - atoms[ATOM_UTF8_STRING], 8, PropModeReplace, title, len); - XChangeProperty(win->env.dpy, win->xwin, atoms[ATOM__NET_WM_ICON_NAME], - atoms[ATOM_UTF8_STRING], 8, PropModeReplace, title, len); + if ((len = get_win_title(title, ARRLEN(title), init)) > 0) { + for (i = 0; i < ARRLEN(targets); ++i) { + XChangeProperty(win->env.dpy, win->xwin, atoms[targets[i]], + atoms[ATOM_UTF8_STRING], 8, PropModeReplace, title, len); + } + } } void win_set_cursor(win_t *win, cursor_t cursor) |