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 <sunzhigang1@kylinos.cn>
This commit is contained in:
sunzhguy 2025-10-10 10:49:43 +08:00
parent a962d58727
commit d7061bc3af

View file

@ -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) {