Commit 713a675401cea4cde9f2bfb3771f3c32554bb278

Ethan Lee 2022-03-26T22:26:15

wayland: Relax the check for mismatching output scales

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index 52a324c..77925ad 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -307,11 +307,13 @@ xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output,
         /* FIXME: GNOME has a bug where the logical size does not account for
          * scale, resulting in bogus viewport sizes.
          *
-         * Until this is fixed, validate the scale, then override if necessary.
+         * Until this is fixed, validate that _some_ kind of scaling is being
+         * done (we can't match exactly because fractional scaling can't be
+         * detected otherwise), then override if necessary.
          * -flibit
          */
         const float scale = (float) driverdata->width / (float) width;
-        if (scale != driverdata->scale_factor) {
+        if ((scale == 1.0f) && (driverdata->scale_factor != 1.0f)) {
             SDL_LogWarn(
                 SDL_LOG_CATEGORY_VIDEO,
                 "xdg_output scale did not match, overriding with wl_output scale"