From b42fc4f2b104b555ef7aca75c4d0edc894d11478 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 28 Oct 2018 09:49:30 +0100 Subject: render: on Wayland, make eglSwapBuffers non-blocking --- render/egl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'render') diff --git a/render/egl.c b/render/egl.c index cfa37f20..644f94ac 100644 --- a/render/egl.c +++ b/render/egl.c @@ -130,6 +130,8 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, goto error; } + egl->platform = platform; + EGLint major, minor; if (eglInitialize(egl->display, &major, &minor) == EGL_FALSE) { wlr_log(WLR_ERROR, "Failed to initialize EGL"); @@ -319,6 +321,11 @@ bool wlr_egl_is_current(struct wlr_egl *egl) { bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface, pixman_region32_t *damage) { + // Never block when swapping buffers on Wayland + if (egl->platform == EGL_PLATFORM_WAYLAND_EXT) { + eglSwapInterval(egl->display, 0); + } + EGLBoolean ret; if (damage != NULL && (egl->exts.swap_buffers_with_damage_ext || egl->exts.swap_buffers_with_damage_khr)) { -- cgit v1.2.3