diff options
author | Bert <ber.t@gmx.com> | 2011-01-20 17:00:59 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-01-20 17:00:59 +0100 |
commit | 08018427c61435de9cd8dca1d1cc9bb69ca2fd74 (patch) | |
tree | 33b4144194d1e30c87331ae6613d151c1147c947 /window.c | |
parent | eeb58886a5b9d7460f81a1e3216692b5dc3a6341 (diff) | |
download | nsxiv-08018427c61435de9cd8dca1d1cc9bb69ca2fd74.tar.zst |
Put some useful information in the window title
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -72,8 +72,7 @@ void win_open(win_t *win) { XSelectInput(e->dpy, win->xwin, StructureNotifyMask | ExposureMask | KeyPressMask); - XStoreName(e->dpy, win->xwin, "sxiv"); - XSetIconName(e->dpy, win->xwin, "Sxiv"); + win_set_title(win, "sxiv"); if ((classhint = XAllocClassHint())) { classhint->res_name = "sxiv"; @@ -94,6 +93,17 @@ void win_close(win_t *win) { XCloseDisplay(win->env.dpy); } +void win_set_title(win_t *win, const char *title) { + if (!win) + return; + + if (!title) + title = "sxiv"; + + XStoreName(win->env.dpy, win->xwin, title); + XSetIconName(win->env.dpy, win->xwin, title); +} + int win_configure(win_t *win, XConfigureEvent *cev) { int changed; |