Browse Source

wayland: Relax the check for mismatching output scales

Ethan Lee 3 years ago
parent
commit
713a675401
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/video/wayland/SDL_waylandvideo.c

+ 4 - 2
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"