Krolyxon
Commit d5f0a20

Branches

Refs →

nsxivd5f0a20

Fixed WMProtocols registration order (before mapping window)

Author
Bert Münnich
Date
2012-08-07 12:09 +0200
Parent
5b64679
Commit
d5f0a20de0c204b81e422530921be0df41f6c6ce

+5 −4

2 files changed

  1. M Makefile +1 −1
  2. M window.c +4 −3
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20120514
1+VERSION = git-20120807
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M window.c View
@@ -128,6 +128,8 @@ void win_init(win_t *win) {
128128 warn("no locale support");
129129
130130 win_init_font(e->dpy, BAR_FONT);
131+
132+ wm_delete_win = XInternAtom(e->dpy, "WM_DELETE_WINDOW", False);
131133 }
132134
133135 void win_set_sizehints(win_t *win) {
@@ -209,6 +211,8 @@ void win_open(win_t *win) {
209211 classhint.res_class = "Sxiv";
210212 XSetClassHint(e->dpy, win->xwin, &classhint);
211213
214+ XSetWMProtocols(e->dpy, win->xwin, &wm_delete_win, 1);
215+
212216 if (!options->hide_bar) {
213217 win->barh = font.ascent + font.descent + 2 * V_TEXT_PAD;
214218 win->h -= win->barh;
@@ -220,9 +224,6 @@ void win_open(win_t *win) {
220224 XMapWindow(e->dpy, win->xwin);
221225 XFlush(e->dpy);
222226
223− wm_delete_win = XInternAtom(e->dpy, "WM_DELETE_WINDOW", False);
224− XSetWMProtocols(e->dpy, win->xwin, &wm_delete_win, 1);
225−
226227 if (options->fullscreen)
227228 win_toggle_fullscreen(win);
228229 }