From 08018427c61435de9cd8dca1d1cc9bb69ca2fd74 Mon Sep 17 00:00:00 2001 From: Bert Date: Thu, 20 Jan 2011 17:00:59 +0100 Subject: Put some useful information in the window title --- window.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'window.c') 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; -- cgit v1.2.3