summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-20 17:00:59 +0100
committerBert <ber.t@gmx.com>2011-01-20 17:00:59 +0100
commit08018427c61435de9cd8dca1d1cc9bb69ca2fd74 (patch)
tree33b4144194d1e30c87331ae6613d151c1147c947 /window.c
parenteeb58886a5b9d7460f81a1e3216692b5dc3a6341 (diff)
downloadnsxiv-08018427c61435de9cd8dca1d1cc9bb69ca2fd74.tar.zst
Put some useful information in the window title
Diffstat (limited to 'window.c')
-rw-r--r--window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/window.c b/window.c
index 3bc35f9..846117c 100644
--- a/window.c
+++ b/window.c
@@ -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;