From 8d0c09bafe37653ed340acd89a27be6a4f928f9c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 27 Jun 2023 12:52:12 +0200 Subject: XInternAtom create if not exists --- src/mgl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/mgl.c b/src/mgl.c index b2d2bb6..5b87134 100644 --- a/src/mgl.c +++ b/src/mgl.c @@ -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(); -- cgit v1.2.3