aboutsummaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
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;