mirror of
https://github.com/sm64-port/sm64-port.git
synced 2024-11-23 06:19:45 +00:00
Exit on window close on Linux. (#35)
This commit is contained in:
parent
4d763e6d47
commit
9f453457fe
@ -411,6 +411,8 @@ static void gfx_glx_get_dimensions(uint32_t *width, uint32_t *height) {
|
||||
}
|
||||
|
||||
static void gfx_glx_handle_events(void) {
|
||||
Atom wm_delete_window = XInternAtom(glx.dpy, "WM_DELETE_WINDOW", 0);
|
||||
XSetWMProtocols(glx.dpy, glx.win, & wm_delete_window, 1);
|
||||
while (XPending(glx.dpy)) {
|
||||
XEvent xev;
|
||||
XNextEvent(glx.dpy, &xev);
|
||||
@ -438,6 +440,11 @@ static void gfx_glx_handle_events(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (xev.type == ClientMessage) {
|
||||
if (xev.xclient.data.l[0] == wm_delete_window) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user