SDL: Fixed logical size synchronization issue on macOS

From 981e1e3c4489add5bf6d4df5415af3cf1ef2773d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 23 Apr 2022 10:32:40 -0700
Subject: [PATCH] Fixed logical size synchronization issue on macOS

https://discourse.libsdl.org/t/sdl-2-0-22-prerelease/35306/6
---
 src/render/opengl/SDL_render_gl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index a0ff1e272f6..b5af52af3db 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -1230,6 +1230,13 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
         }
     }
 
+#ifdef __MACOSX__
+    // On macOS on older systems, the OpenGL view change and resize events aren't
+    // necessarily synchronized, so just always reset it.
+    // Workaround for: https://discourse.libsdl.org/t/sdl-2-0-22-prerelease/35306/6
+    data->drawstate.viewport_dirty = SDL_TRUE;
+#endif
+
     while (cmd) {
         switch (cmd->command) {
             case SDL_RENDERCMD_SETDRAWCOLOR: {