From b7ef2919b0dcecfe65fb2c9b90d4088b7997816d Mon Sep 17 00:00:00 2001 From: road2react <93143714+road2react@users.noreply.github.com> Date: Sat, 3 Jan 2026 20:24:53 -0800 Subject: [PATCH] Wayland: Fix rounding of fractional scale sizes The framebuffer size for fractional scale surfaces should be rounded to the closest integer, not truncated as is currently done. This implements the rounding formula that the discussions over at wayland-protocols item 132 and MR 309 appear to be converging on. Fixes #2713 Closes #2810 --- src/wl_window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index c6abe433..fd8553a5 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -478,8 +478,9 @@ static void resizeFramebuffer(_GLFWwindow* window) { if (window->wl.fractionalScale) { - window->wl.fbWidth = (window->wl.width * window->wl.scalingNumerator) / 120; - window->wl.fbHeight = (window->wl.height * window->wl.scalingNumerator) / 120; + // Round halfway away from zero per fractional-scale-v1 protocol spec + window->wl.fbWidth = (window->wl.width * window->wl.scalingNumerator + 60) / 120; + window->wl.fbHeight = (window->wl.height * window->wl.scalingNumerator + 60) / 120; } else {