diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-04-18 15:14:31 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-04-18 15:14:31 +0200 |
commit | 5500ce377a0a552bfa858232f7086c197d0ab458 (patch) | |
tree | 491d9666e1535c4059b4ac37836517cf8b424867 /src/mgl.c | |
parent | 0e12a1d216b85c8e864cc2d7d18c3d18864542c5 (diff) |
Wayland rendering now works
Diffstat (limited to 'src/mgl.c')
-rw-r--r-- | src/mgl.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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); |