From 82b40f097b0263837292763c36d4b6a6423e1548 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 16 Sep 2022 09:55:20 -0700 Subject: [PATCH] Fixed runaway CPU usage in the metal renderer when the window is minimized --- src/render/metal/SDL_render_metal.m | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 053289022..3dc346d57 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -503,10 +503,6 @@ METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load, static void METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) { - if (event->event == SDL_WINDOWEVENT_SHOWN || - event->event == SDL_WINDOWEVENT_HIDDEN) { - // !!! FIXME: write me - } } static int @@ -1529,7 +1525,7 @@ METAL_RenderPresent(SDL_Renderer * renderer) data.mtlcmdbuffer = nil; data.mtlbackbuffer = nil; - if (!ready) { + if (renderer->hidden || !ready) { return -1; } return 0;