From f222aa79850dbe44843c4d03367db43604c63057 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 26 Apr 2026 23:15:02 -0500 Subject: [PATCH] Use aspect ratio preserving scaling for slow GPUs on non-KDE desktops --- app/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/main.cpp b/app/main.cpp index b1858ff4..1de4a258 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -738,6 +738,19 @@ int main(int argc, char *argv[]) // use this functionality and it can cause hangs when querying broken devices. SDL_SetHint("SDL_WINDOWS_DETECT_DEVICE_HOTPLUG", "0"); + // SDL3 supports offloading scaling to the Wayland compositor, which we take + // advantage of in the GL_IS_SLOW case to help fillrate-limited GPUs. To stay + // consistent with our own scaling logic, we need aspect ratio scaling which + // KDE doesn't currently handle properly. As a compromise, we'll just enable + // aspect ratio scaling in non-KDE environments. + // + // NB: We do not force SDL_VIDEO_WAYLAND_MODE_SCALING to "stretch" on KDE, + // because SDL 3.6 has a workaround for KDE and switches the default to + // "aspect" for all desktops. + if (qgetenv("XDG_CURRENT_DESKTOP") != "KDE") { + SDL_SetHint("SDL_VIDEO_WAYLAND_MODE_SCALING", "aspect"); + } + QGuiApplication app(argc, argv); #ifdef Q_OS_UNIX