shithub: choc

Download patch

ref: 7dd42ec073e68d4c9a32418215704368e2088fc0
parent: a0b556eb8293d3157b6206a8dfd9d845952a0f65
author: Fabian Greffrath <fabian@greffrath.com>
date: Fri May 19 04:36:32 EDT 2017

video: omit drawing to screen until the window resize has finished

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -709,24 +709,31 @@
     if (noblit)
         return;
 
-    if (need_resize && SDL_GetTicks() > last_resize_time + 500)
+    if (need_resize)
     {
-        int flags;
-        // When the window is resized (we're not in fullscreen mode),
-        // save the new window size.
-        flags = SDL_GetWindowFlags(screen);
-        if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == 0)
+        if (SDL_GetTicks() > last_resize_time + 500)
         {
-            SDL_GetWindowSize(screen, &window_width, &window_height);
+            int flags;
+            // When the window is resized (we're not in fullscreen mode),
+            // save the new window size.
+            flags = SDL_GetWindowFlags(screen);
+            if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == 0)
+            {
+                SDL_GetWindowSize(screen, &window_width, &window_height);
 
-            // Adjust the window by resizing again so that the window
-            // is the right aspect ratio.
-            AdjustWindowSize();
-            SDL_SetWindowSize(screen, window_width, window_height);
+                // Adjust the window by resizing again so that the window
+                // is the right aspect ratio.
+                AdjustWindowSize();
+                SDL_SetWindowSize(screen, window_width, window_height);
+            }
+            CreateUpscaledTexture(false);
+            need_resize = false;
+            palette_to_set = true;
         }
-        CreateUpscaledTexture(false);
-        need_resize = false;
-        palette_to_set = true;
+        else
+        {
+            return;
+        }
     }
 
     UpdateGrab();