SDL: wayland: Round fractional scale values when viewports aren't supported

From 38c4f29c29006b68279fbe49d7598133f3e10429 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Wed, 10 Apr 2024 15:58:42 -0400
Subject: [PATCH] wayland: Round fractional scale values when viewports aren't
 supported

---
 src/video/wayland/SDL_waylandwindow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index c68860cc5b438..005ae7406fa78 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -1193,6 +1193,11 @@ static void Wayland_HandlePreferredScaleChanged(SDL_WindowData *window_data, flo
         return;
     }
 
+    /* Round the scale factor if viewports aren't available. */
+    if (!window_data->viewport) {
+        factor = SDL_ceilf(factor);
+    }
+
     if (!FloatEqual(factor, old_factor)) {
         window_data->windowed_scale_factor = factor;