From acac784c2b7148d3f749dca9f59a3e4e5ee3fe8e Mon Sep 17 00:00:00 2001 From: tetrisgm <30949000+tetrisgm@users.noreply.github.com> Date: Thu, 27 Aug 2026 17:51:22 -0700 Subject: [PATCH] runtime: preserve adaptive 4:3 across DPI rounding (cherry picked from commit b6aedc800a0a7375ba7c31344c03a3b9d401edfd) --- runtime/src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 40d16fcf..d9fade8f 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -1658,7 +1658,11 @@ static void update_adaptive_widescreen() { if (width <= 0 || height <= 0) return; int num = width, den = height; - if ((int64_t)width * 3 <= (int64_t)height * 4) { + /* A nominal 4:3 client can be one physical pixel wider after fractional-DPI + * conversion (for example 960x720 -> 2161x1620 at 225%). Keep that + * rounding pixel in the identity fallback instead of engaging an almost- + * identity widescreen squash and its cull guard. */ + if ((int64_t)(width - 1) * 3 <= (int64_t)height * 4) { num = 4; den = 3; } else if ((int64_t)width * g_ws_adaptive_max_den >= (int64_t)height * g_ws_adaptive_max_num) {