From 7c44187868e59355f598180a3e96ece09826ea1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Sat, 17 Feb 2024 13:35:47 -0500
Subject: [PATCH] For SDL mode, ensure rect matches vstat as well.

---
 src/conio/sdl_con.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/conio/sdl_con.c b/src/conio/sdl_con.c
index 1fb66cedb8..c66942a7cb 100644
--- a/src/conio/sdl_con.c
+++ b/src/conio/sdl_con.c
@@ -1050,6 +1050,8 @@ void sdl_video_event_thread(void *data)
 						update_cvstat(&cvstat);
 						pthread_mutex_lock(&vstatlock);
 						// Get correct aspect ratio for dst...
+						int sw = cvstat.scrnwidth;
+						int sh = cvstat.scrnheight;
 						bitmap_get_scaled_win_size(cvstat.scaling, &dst.w, &dst.h, cvstat.winwidth, cvstat.winheight);
 						pthread_mutex_unlock(&vstatlock);
 						pthread_mutex_lock(&win_mutex);
@@ -1066,7 +1068,7 @@ void sdl_video_event_thread(void *data)
 								SDL_Rect src;
 
 								old_next = list->next;
-								if (list->next == NULL && !skipit) {
+								if (list->next == NULL && !skipit && sw == list->rect.width && sh == list->rect.height) {
 									void *pixels;
 									int pitch;
 									int row;
-- 
GitLab