diff options
-rw-r--r-- | video/out/opengl/context_wayland.c | 2 | ||||
-rw-r--r-- | video/out/vo_wlshm.c | 2 | ||||
-rw-r--r-- | video/out/vulkan/context_wayland.c | 2 | ||||
-rw-r--r-- | video/out/wayland_common.c | 7 | ||||
-rw-r--r-- | video/out/wayland_common.h | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index 11e2c5d735..713ea8a36f 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -60,7 +60,7 @@ static bool wayland_egl_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_ { struct ra_ctx *ctx = sw->ctx; struct vo_wayland_state *wl = ctx->vo->wl; - bool render = wl->render || wl->opts->disable_vsync; + bool render = !wl->hidden || wl->opts->disable_vsync; wl->frame_wait = true; return render ? ra_gl_ctx_start_frame(sw, out_fbo) : false; diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index e6ba0875f0..5e7ae94a1d 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -218,7 +218,7 @@ static void draw_image(struct vo *vo, struct mp_image *src) struct priv *p = vo->priv; struct vo_wayland_state *wl = vo->wl; struct buffer *buf; - bool render = wl->render || wl->opts->disable_vsync; + bool render = !wl->hidden || wl->opts->disable_vsync; wl->frame_wait = true; if (!render) diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c index a6ae29fd15..6097fa5a19 100644 --- a/video/out/vulkan/context_wayland.c +++ b/video/out/vulkan/context_wayland.c @@ -29,7 +29,7 @@ struct priv { static bool wayland_vk_start_frame(struct ra_ctx *ctx) { struct vo_wayland_state *wl = ctx->vo->wl; - bool render = wl->render || wl->opts->disable_vsync; + bool render = !wl->hidden || wl->opts->disable_vsync; wl->frame_wait = true; return render; diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 1cc41e648f..3e0ed8bbec 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1964,18 +1964,17 @@ void vo_wayland_wait_frame(struct vo_wayland_state *wl) if (wl->frame_wait) { // Only consider consecutive missed callbacks. if (wl->timeout_count > 1) { - wl->render = false; + wl->hidden = true; return; } else { wl->timeout_count += 1; - wl->render = true; + wl->hidden = false; return; } } wl->timeout_count = 0; - wl->render = true; - return; + wl->hidden = false; } void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us) diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index f6075ae4cf..9d8c514d47 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -58,7 +58,7 @@ struct vo_wayland_state { bool has_keyboard_input; bool focused; bool frame_wait; - bool render; + bool hidden; bool state_change; bool toplevel_configured; int display_fd; |