diff --git a/pkgs/kde/third-party/wallpaper-engine-plugin/default.nix b/pkgs/kde/third-party/wallpaper-engine-plugin/default.nix index 2cc012ab5a2d..529e98c53668 100644 --- a/pkgs/kde/third-party/wallpaper-engine-plugin/default.nix +++ b/pkgs/kde/third-party/wallpaper-engine-plugin/default.nix @@ -27,7 +27,10 @@ mkKdeDerivation { fetchSubmodules = true; }; - patches = [ ./nix-plugin.patch ]; + patches = [ + ./nix-plugin.patch + ./qt-6.10-fix.patch + ]; extraNativeBuildInputs = [ kpackage @@ -52,6 +55,7 @@ mkKdeDerivation { ] )) (lib.cmakeFeature "Qt6_DIR" "${qtbase}/lib/cmake/Qt6") + "-DCMAKE_CXX_FLAGS=-Wno-error=stringop-overflow" ]; postInstall = '' diff --git a/pkgs/kde/third-party/wallpaper-engine-plugin/qt-6.10-fix.patch b/pkgs/kde/third-party/wallpaper-engine-plugin/qt-6.10-fix.patch new file mode 100644 index 000000000000..fb9d15f02baa --- /dev/null +++ b/pkgs/kde/third-party/wallpaper-engine-plugin/qt-6.10-fix.patch @@ -0,0 +1,42 @@ +--- a/src/backend_mpv/MpvBackend.cpp ++++ b/src/backend_mpv/MpvBackend.cpp +@@ -37,7 +37,9 @@ + # include // IWYU pragma: keep + #endif + //#endif ++#if (QT_VERSION < QT_VERSION_CHECK(6, 10, 0)) + # include // IWYU pragma: keep ++#endif + #endif + + Q_LOGGING_CATEGORY(wekdeMpv, "wekde.mpv") +@@ -85,8 +87,13 @@ int CreateMpvContex(mpv_handle* mpv, mpv_render_context** mpv_gl) { + if (QGuiApplication::platformName().contains("xcb")) { + params[2].type = MPV_RENDER_PARAM_X11_DISPLAY; + #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +- // TODO: QGuiApplication::nativeInterface()::display(); +- // same for wayland ++#if (QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)) ++ if (auto x11App = qApp->nativeInterface()) { ++ params[2].data = x11App->display(); ++ } ++#else ++ // Fallback for Qt 6.0-6.9 + auto* native = QGuiApplication::platformNativeInterface(); + params[2].data = native->nativeResourceForWindow("display", nullptr); ++#endif + #else +@@ -95,6 +102,12 @@ int CreateMpvContex(mpv_handle* mpv, mpv_render_context** mpv_gl) { + } + if (QGuiApplication::platformName().contains("wayland")) { + params[2].type = MPV_RENDER_PARAM_WL_DISPLAY; ++#if (QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)) ++ if (auto waylandApp = qApp->nativeInterface()) { ++ params[2].data = waylandApp->display(); ++ } ++#else + auto* native = QGuiApplication::platformNativeInterface(); + params[2].data = native->nativeResourceForWindow("display", nullptr); ++#endif + } + #endif