From ad571e7448eb53fb099ec0cb87baf97cb38d3450 Mon Sep 17 00:00:00 2001 From: NRK Date: Sun, 27 Feb 2022 16:53:45 +0600 Subject: always initialize window title before if exec/win-title didn't exist then window title wouldn't be set. this patch makes it so window title is always set to something. --- window.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 9bfc2ec..fb9c776 100644 --- a/window.c +++ b/window.c @@ -30,7 +30,7 @@ #include #include -extern size_t get_win_title(unsigned char *, int); +extern size_t get_win_title(unsigned char *, int, bool); #if HAVE_LIBFONTS #include "utf8.h" @@ -289,9 +289,9 @@ void win_open(win_t *win) } free(icon_data); - /* These two atoms won't change and thus only need to be set once. */ 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; @@ -503,12 +503,12 @@ void win_draw_rect(win_t *win, int x, int y, int w, int h, bool fill, int lw, XDrawRectangle(win->env.dpy, win->buf.pm, gc, x, y, w, h); } -void win_set_title(win_t *win) +void win_set_title(win_t *win, bool init) { unsigned char title[512]; size_t len; - if ((len = get_win_title(title, ARRLEN(title))) <= 0) + if ((len = get_win_title(title, ARRLEN(title), init)) <= 0) return; XChangeProperty(win->env.dpy, win->xwin, atoms[ATOM__NET_WM_NAME], -- cgit v1.2.3-54-g00ecf