diff options
author | der richter <der.richter@gmx.de> | 2024-03-06 22:02:43 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2024-03-06 23:37:32 +0200 |
commit | 68c61fd89f4c825ac559589458f406b4c92d04c6 (patch) | |
tree | 20995859f86a1f0f2a8fd5005515dbfe4c3bf403 /video/out/vulkan | |
parent | 6016423427ffdad29841093a588c57374c2ad108 (diff) | |
download | mpv-68c61fd89f4c825ac559589458f406b4c92d04c6.tar.bz2 mpv-68c61fd89f4c825ac559589458f406b4c92d04c6.tar.xz |
mac/vulkan: directly retrieve current render size without caching
the render size cached in ctx->vo->dwidth/dheight can be outdated in
some circumstances at the time the context needs resizing. instead use
the current render size.
Diffstat (limited to 'video/out/vulkan')
-rw-r--r-- | video/out/vulkan/context_mac.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/video/out/vulkan/context_mac.m b/video/out/vulkan/context_mac.m index 38b34ff029..5621e6dca3 100644 --- a/video/out/vulkan/context_mac.m +++ b/video/out/vulkan/context_mac.m @@ -85,7 +85,14 @@ error: static bool resize(struct ra_ctx *ctx) { - return ra_vk_ctx_resize(ctx, ctx->vo->dwidth, ctx->vo->dheight); + struct priv *p = ctx->priv; + + if (!p->vo_mac.window) { + return false; + } + CGSize size = p->vo_mac.window.framePixel.size; + + return ra_vk_ctx_resize(ctx, (int)size.width, (int)size.height); } static bool mac_vk_reconfig(struct ra_ctx *ctx) |