Let the window be closed

This commit is contained in:
Pierre Pronchery 2020-04-11 08:12:30 +02:00
parent 3332b40f21
commit 90a2337a00

View File

@ -37,6 +37,7 @@ GWindow * gwindow_new(void)
XVisualInfo * visual; XVisualInfo * visual;
GWindow * gwindow; GWindow * gwindow;
XSetWindowAttributes attr; XSetWindowAttributes attr;
Atom a;
if((gwindow = malloc(sizeof(*gwindow))) == NULL) if((gwindow = malloc(sizeof(*gwindow))) == NULL)
return NULL; /* FIXME report */ return NULL; /* FIXME report */
@ -57,6 +58,8 @@ GWindow * gwindow_new(void)
0, visual->depth, InputOutput, visual->visual, 0, visual->depth, InputOutput, visual->visual,
CWBorderPixel | CWColormap | CWEventMask, &attr); CWBorderPixel | CWColormap | CWEventMask, &attr);
gwindow->context = glXCreateContext(display, visual, 0, GL_TRUE); gwindow->context = glXCreateContext(display, visual, 0, GL_TRUE);
a = XInternAtom(display, "WM_DELETE_WINDOW", True);
XSetWMProtocols(display, gwindow->window, &a, 1);
gtoolkit_register_window(gwindow); gtoolkit_register_window(gwindow);
return gwindow; return gwindow;
} }