From 3f02997602c1550fcc8515d5ce119ff5695864cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Thu, 22 Feb 2024 08:35:58 -0500
Subject: [PATCH] Fix some weirdness around window sizing.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This should fix the recent issue when a larger or smaller version
is painted inside the window after resize, as well as fix ALT-→
when the current size is not an integer multiple.
---
 src/conio/x_events.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index 7647816b7e..551cf5417c 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -1200,12 +1200,9 @@ static void init_mode_internal(int mode)
 	ow = vstat.winwidth;
 	oh = vstat.winheight;
 	bitmap_drv_init_mode(mode, NULL, NULL, mw, mh);
-	x_cvstat = vstat;
-	if (fullscreen) {
-		vstat.winwidth = ow;
-		vstat.winheight = oh;
-		vstat.scaling = bitmap_double_mult_inside(ow, oh);
-	}
+	vstat.winwidth = ow;
+	vstat.winheight = oh;
+	vstat.scaling = bitmap_double_mult_inside(ow, oh);
 	pthread_mutex_unlock(&vstatlock);
 	resize_window();
 	pthread_mutex_lock(&vstatlock);
@@ -2054,7 +2051,7 @@ x11_event(XEvent *ev)
 										pthread_mutex_lock(&vstatlock);
 										ms = bitmap_largest_mult_inside(mw, mh);
 										pthread_mutex_unlock(&vstatlock);
-										if (x_cvstat.scaling + 1 <= ms)
+										if (ival + 1 <= ms)
 											x_setscaling(ival + 1);
 									}
 								}
-- 
GitLab