From 5500ce377a0a552bfa858232f7086c197d0ab458 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 18 Apr 2025 15:14:31 +0200 Subject: Wayland rendering now works --- src/mgl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mgl.c') diff --git a/src/mgl.c b/src/mgl.c index d0e344f..fdf5c5b 100644 --- a/src/mgl.c +++ b/src/mgl.c @@ -64,13 +64,13 @@ static bool is_xwayland(Display *dpy) { } static int mgl_init_x11(void) { - if(!context.connection) - context.connection = XOpenDisplay(NULL); - if(!context.connection) { - fprintf(stderr, "mgl error: mgl_init_x11: failed to connect to the X11 server\n"); - mgl_deinit(); - return -1; + context.connection = XOpenDisplay(NULL); + if(!context.connection) { + fprintf(stderr, "mgl error: mgl_init_x11: failed to connect to the X11 server\n"); + mgl_deinit(); + return -1; + } } connected_to_display_server = true; /* If we dont call we will never get a MappingNotify until a key has been pressed */ @@ -241,7 +241,7 @@ void mgl_ping_display_server(void) { if(!context.connection) return; - // TODO: Do something equivalent for wayland + // TODO: Do something equivalent for wayland, maybe wl_display_roundtrip and if it returns -1 then the connection to the server died if(context.window_system == MGL_WINDOW_SYSTEM_X11) { XNoOp(context.connection); XFlush(context.connection); -- cgit v1.2.3-70-g09d2