From 264b81b48156852c2a6168fb72af76746cdd8555 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 6 Sep 2018 00:56:13 -0400 Subject: [PATCH] metal: Make sure layer drawableSize is adjusted on resize. Fixes Bugzilla #4250. --- src/render/metal/SDL_render_metal.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 5afedab86..10c585b20 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -752,8 +752,12 @@ METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load) static void METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) { - if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED || - event->event == SDL_WINDOWEVENT_SHOWN || + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { + METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; + data.mtllayer.drawableSize = CGSizeMake(event->data1, event->data2); + } + + if (event->event == SDL_WINDOWEVENT_SHOWN || event->event == SDL_WINDOWEVENT_HIDDEN) { // !!! FIXME: write me }