From df75127fc84e0d4f84da7480b8f272d79a1dd2a8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 30 Nov 2025 21:51:06 +1000 Subject: [PATCH] Qt: Disable AA_DontCreateNativeWidgetSiblings hack on KDE Seems this is no longer needed... but it still breaks on GNOME, because of course... Almost at the point of just forcing XWayland on everything except KDE. --- src/duckstation-qt/qthost.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 8398de826..5f6f7de6b 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -329,26 +329,25 @@ void QtHost::ApplyWaylandWorkarounds() return; } - std::fputs("Wayland platform detected, applying workarounds.\n", stderr); - - // On Wayland, turning any window into a native window causes DPI scaling to break, as well as window - // updates, creating a complete mess of a window. Setting this attribute isn't ideal, since you'd think - // that setting WA_DontCreateNativeAncestors on the widget would be sufficient, but apparently not. - QGuiApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); - - // When rendering fullscreen or to a separate window on Wayland, because we take over the surface we need - // to wrap the widget in a container because GNOME is stupid and refuses to ever support server-side - // decorations. There's no sign of this ever changing. Fuck Wayland. if (const char* desktop = std::getenv("XDG_SESSION_DESKTOP"); desktop && std::strcmp(desktop, "KDE") == 0) { - std::fputs("Wayland with KDE detected, not creating display widget containers.\n", stderr); + std::fputs("Wayland with KDE detected, not applying Wayland workarounds.\n", stderr); } else { - std::fputs("Wayland with non-KDE desktop detected, creating display widget containers.\n" + std::fputs("Wayland with non-KDE desktop detected, applying Wayland workarounds.\n" "Don't complain when things break.\n", stderr); + + // When rendering fullscreen or to a separate window on Wayland, because we take over the surface we need + // to wrap the widget in a container because GNOME is stupid and refuses to ever support server-side + // decorations. There's no sign of this ever changing. Fuck Wayland. s_state.display_container_needed = true; + + // On Wayland, turning any window into a native window causes DPI scaling to break, as well as window + // updates, creating a complete mess of a window. Setting this attribute isn't ideal, since you'd think + // that setting WA_DontCreateNativeAncestors on the widget would be sufficient, but apparently not. + QGuiApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); } }