forked from e16/e16
1
0
Fork 0

Close properly.

SVN revision: 15007
This commit is contained in:
Kim Woelders 2005-05-29 09:32:18 +00:00
parent ecd56c907f
commit 2cb4df9350
1 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,9 @@ Imlib_Image *im_next1, *im_next2;
Imlib_Image *im_exit1, *im_exit2;
char *docdir = NULL;
static Atom ATOM_WM_DELETE_WINDOW = None;
static Atom ATOM_WM_PROTOCOLS = None;
static Window
FindRootWindow(Display * dpy)
{
@ -153,6 +156,10 @@ CreateWindow(Window parent, int x, int y, int ww, int hh)
hnt.max_height = hh;
XSetWMNormalHints(disp, win, &hnt);
ATOM_WM_PROTOCOLS = XInternAtom(disp, "WM_PROTOCOLS", False);
ATOM_WM_DELETE_WINDOW = XInternAtom(disp, "WM_DELETE_WINDOW", False);
XSetWMProtocols(disp, win, &ATOM_WM_DELETE_WINDOW, 1);
return win;
}
@ -664,10 +671,17 @@ main(int argc, char **argv)
}
}
break;
case ClientMessage:
if (ev.xclient.message_type == ATOM_WM_PROTOCOLS &&
(Atom) ev.xclient.data.l[0] == ATOM_WM_DELETE_WINDOW)
goto done;
break;
default:
break;
}
}
done:
return 0;
}
void