From a747488f12070c0fc1c8fa4a7d1dd810cdb68ffb Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Sun, 29 Jan 2023 21:42:10 +0100
Subject: [PATCH] Update DisplayMode awareness
---
src/sdl2_compat.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index a8b6644..3e7d101 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -1064,6 +1064,9 @@ SDL2Compat_InitOnStartup(void)
strcpy_fn(loaderror, "Failed to initialize sdl2-compat library.");
}
+ SDL3_SetHint("SDL_WINDOWS_DPI_SCALING", 0);
+ SDL3_SetHint("SDL_WINDOWS_DPI_AWARENESS", "unaware");
+
return okay;
}
@@ -3352,8 +3355,8 @@ static void
DisplayMode_3to2(const SDL_DisplayMode *in, SDL2_DisplayMode *out) {
if (in && out) {
out->format = in->format;
- out->w = in->pixel_w;
- out->h = in->pixel_h;
+ out->w = in->screen_w;
+ out->h = in->screen_h;
out->refresh_rate = (int) SDL3_ceil(in->refresh_rate);
out->driverdata = in->driverdata;
}