diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-06-27 12:52:12 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-06-27 12:52:12 +0200 |
commit | 8d0c09bafe37653ed340acd89a27be6a4f928f9c (patch) | |
tree | ad2b9cc1c7f86c1925d377f2fa8d77cc07ffa8a7 | |
parent | 3cc088e1c3866b57b4392bb8430774e7e40be57a (diff) |
XInternAtom create if not exists
-rw-r--r-- | src/mgl.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -27,7 +27,7 @@ int mgl_init(void) { if(init_count == 1) { context.connection = XOpenDisplay(NULL); if(!context.connection) { - fprintf(stderr, "mgl error:XOpenDisplay(NULL) failed\n"); + fprintf(stderr, "mgl error: XOpenDisplay failed\n"); mgl_deinit(); return -1; } @@ -38,13 +38,8 @@ int mgl_init(void) { XkbSetDetectableAutoRepeat(context.connection, True, NULL); context.wm_delete_window_atom = XInternAtom(context.connection, "WM_DELETE_WINDOW", False); - if(!context.wm_delete_window_atom) { - mgl_deinit(); - return -1; - } - - context.net_wm_ping_atom = XInternAtom(context.connection, "_NET_WM_PING", True); - context.net_wm_pid_atom = XInternAtom(context.connection, "_NET_WM_PID", True); + context.net_wm_ping_atom = XInternAtom(context.connection, "_NET_WM_PING", False); + context.net_wm_pid_atom = XInternAtom(context.connection, "_NET_WM_PID", False); if(mgl_gl_load(&context.gl) != 0) { mgl_deinit(); |