From d731741f046eecdf2788154b0387baf8f2e67007 Mon Sep 17 00:00:00 2001 From: Bert Date: Wed, 9 Feb 2011 10:01:49 +0100 Subject: Handle WM_DELETE_WINDOW messages correctly, thanks to fungt --- window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index ce69b5d..76a8e87 100644 --- a/window.c +++ b/window.c @@ -28,9 +28,10 @@ static Cursor arrow; static Cursor hand; - static GC bgc; +Atom wm_delete_win; + void win_set_sizehints(win_t *win) { XSizeHints sizehints; @@ -122,6 +123,9 @@ void win_open(win_t *win) { XMapWindow(e->dpy, win->xwin); XFlush(e->dpy); + + wm_delete_win = XInternAtom(e->dpy, "WM_DELETE_WINDOW", False); + XSetWMProtocols(e->dpy, win->xwin, &wm_delete_win, 1); if (options->fullscreen) win_toggle_fullscreen(win); -- cgit v1.2.3