aboutsummaryrefslogtreecommitdiff
path: root/src/mgl.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-06 15:55:42 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-06 15:55:42 +0100
commitcb679636f77fe2a03e8dab3a511e28e1ab898316 (patch)
treeb03cada4a37a50eb50cef1e21c75c56d938868a8 /src/mgl.c
parente2e7c0bf0747d55967c4be6374f3611cd96babb6 (diff)
Fix exit being called when closing window, respond to wm ping, add is_open function to window
Diffstat (limited to 'src/mgl.c')
-rw-r--r--src/mgl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mgl.c b/src/mgl.c
index 7940def..02fe8a5 100644
--- a/src/mgl.c
+++ b/src/mgl.c
@@ -74,6 +74,8 @@ int mgl_init(void) {
return -1;
}
+ context.net_wm_ping_atom = XInternAtom(context.connection, "_NET_WM_PING", True);
+
if(mgl_gl_load(&context.gl) != 0) {
mgl_deinit();
return -1;
@@ -90,9 +92,6 @@ int mgl_init(void) {
void mgl_deinit(void) {
if(init_count == 1) {
if(context.connection) {
- glx_context_deinit();
- mgl_gl_unload(&context.gl);
-
XSetIOErrorHandler(prev_xioerror);
prev_xioerror = NULL;
@@ -101,6 +100,13 @@ void mgl_deinit(void) {
XCloseDisplay(context.connection);
context.connection = NULL;
+
+ /*
+ GLX needs to be unloaded after closing the display on nvidia because
+ nvidia registers cleanup callbacks on exit, that uses the x11 display.
+ */
+ glx_context_deinit();
+ mgl_gl_unload(&context.gl);
}
}