From d7061bc3af4ce4463dc7e35b10976fe41d5dfee5 Mon Sep 17 00:00:00 2001 From: sunzhguy Date: Fri, 10 Oct 2025 10:49:43 +0800 Subject: [PATCH] output: fix effective resolution calculation with ceil() Use ceil() instead of integer division in wlr_output_effective_resolution() to prevent truncation of fractional values when output scale doesn't evenly divide the physical resolution. This ensures logical resolution properly covers all physical pixels. Signed-off-by: sunzhguy --- types/output/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/output/output.c b/types/output/output.c index 3715950ce..4dbecf47e 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -467,8 +467,8 @@ void wlr_output_transformed_resolution(struct wlr_output *output, void wlr_output_effective_resolution(struct wlr_output *output, int *width, int *height) { wlr_output_transformed_resolution(output, width, height); - *width /= output->scale; - *height /= output->scale; + *width = ceil(*width / output->scale); + *height = ceil(*height / output->scale); } struct wlr_output_mode *wlr_output_preferred_mode(struct wlr_output *output) {