From 87f05b6d89fd176435a80fd09ea2bb6f7e7d5efa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Sun, 14 May 2023 23:41:54 -0400
Subject: [PATCH] Use vstat.scaling not x_cvstat.scaling to scale to screen.

Also, do not try to display frames where the scaled height or width
is less than the frame bitmap height or width.
---
 src/conio/x_events.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index aacc42b574..c5a4084d6d 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -601,8 +601,12 @@ local_draw_rect(struct rectlist *rect)
 
 	// Scale...
 	pthread_mutex_lock(&vstatlock);
-	bitmap_get_scaled_win_size(x_cvstat.scaling, &w, &h, vstat.winwidth, vstat.winheight);
+	bitmap_get_scaled_win_size(vstat.scaling, &w, &h, vstat.winwidth, vstat.winheight);
 	pthread_mutex_unlock(&vstatlock);
+	if (w < rect->rect.width || h < rect->rect.height) {
+		bitmap_drv_free_rect(rect);
+		return;
+	}
 	source = do_scale(rect, w, h);
 	bitmap_drv_free_rect(rect);
 	if (source == NULL)
-- 
GitLab