From 4c7c8daf9ccea7ac6a9089be362d254771c50811 Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Mon, 9 Oct 2017 02:08:36 +0100 Subject: wayland_common: implement output tracking, cleanups and bugfixes This commit: - Implements output tracking (e.g. monitor plug/unplug) - Creates the surface during registry (no other dependencies) - Queues the callback immediately after surface creation - Cleaner and better event handling (functions return directly) - Better reconfigure handling (resizes reduced to 1 during init) - Don't unnecessarily resize (if dimensions match) Apart from that fixes 2 potential memory leaks (mime type and window title), 2 string ownership issues (output name and make need to be dup'd), fixes some style issues (switches were indented) and finally adds messages when disabling/enabling idle inhibition. The callback setter function was removed in preparation for the commit which will use the frame event cb because it was unnecessary. --- video/out/opengl/context_wayland.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'video/out/opengl/context_wayland.c') diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index 2d3c22abc1..f686fcc4cf 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -39,7 +39,7 @@ static void resize(struct ra_ctx *ctx) struct priv *p = ctx->priv; struct vo_wayland_state *wl = ctx->vo->wl; - MP_VERBOSE(wl, "Handling resizing on the egl side\n"); + MP_VERBOSE(wl, "Handling resize on the egl side\n"); const int32_t width = wl->scaling*mp_rect_w(wl->geometry); const int32_t height = wl->scaling*mp_rect_h(wl->geometry); @@ -85,8 +85,6 @@ static bool egl_create_context(struct ra_ctx *ctx) if (!ra_gl_ctx_init(ctx, &p->gl, params)) return false; - vo_wayland_set_cb_exec(ctx->vo, NULL, NULL); - return true; } @@ -104,8 +102,6 @@ static void egl_create_window(struct ra_ctx *ctx) eglMakeCurrent(p->egl_display, p->egl_surface, p->egl_surface, p->egl_context); eglSwapInterval(p->egl_display, 0); - - wl_display_roundtrip(wl->display); } static bool wayland_egl_reconfig(struct ra_ctx *ctx) -- cgit v1.2.3