summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-02-27 11:53:45 +0100
committerN-R-K <79544946+N-R-K@users.noreply.github.com>2022-03-02 10:32:35 +0100
commitad571e7448eb53fb099ec0cb87baf97cb38d3450 (patch)
tree80c383fe14a4cf63e828142d47e62ffabab740d2 /window.c
parentbdd9521bf3ea86b3cd83b070728b58227d821ff8 (diff)
downloadnsxiv-ad571e7448eb53fb099ec0cb87baf97cb38d3450.tar.zst
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.
Diffstat (limited to 'window.c')
-rw-r--r--window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/window.c b/window.c
index 9bfc2ec..fb9c776 100644
--- a/window.c
+++ b/window.c
@@ -30,7 +30,7 @@
#include <X11/Xatom.h>
#include <X11/Xresource.h>
-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],