File plasma-framework-5.103.0-fix-mingw-build.patch of Package mingw32-plasma-framework
diff -ur plasma-framework-5.103.0/src/declarativeimports/core/windowthumbnail.cpp plasma-framework-5.103.0/src/declarativeimports/core/windowthumbnail.cpp
--- plasma-framework-5.103.0/src/declarativeimports/core/windowthumbnail.cpp 2023-02-05 10:28:11.000000000 +0100
+++ plasma-framework-5.103.0/src/declarativeimports/core/windowthumbnail.cpp 2024-07-04 13:49:32.196280354 +0200
@@ -5,7 +5,9 @@
*/
#include "windowthumbnail.h"
// KF5
+#if HAVE_X11
#include <KX11Extras>
+#endif
// Qt
#include <QGuiApplication>
#include <QIcon>
@@ -275,10 +277,12 @@
if (m_winId == winId) {
return;
}
+#if HAVE_X11
if (!KX11Extras::self()->hasWId(winId)) {
// invalid Id, don't updated
return;
}
+#endif
if (window() && winId == window()->winId()) {
// don't redirect to yourself
return;
@@ -383,9 +387,12 @@
void WindowThumbnail::iconToTexture(WindowTextureProvider *textureProvider)
{
QIcon icon;
+#if HAVE_X11
if (KX11Extras::self()->hasWId(m_winId)) {
icon = KX11Extras::self()->icon(m_winId, boundingRect().width(), boundingRect().height());
- } else {
+ } else
+#endif
+ {
// fallback to plasma icon
icon = QIcon::fromTheme(QStringLiteral("plasma"));
}
diff -ur plasma-framework-5.103.0/src/declarativeimports/platformcomponents/icondialog.cpp plasma-framework-5.103.0/src/declarativeimports/platformcomponents/icondialog.cpp
--- plasma-framework-5.103.0/src/declarativeimports/platformcomponents/icondialog.cpp 2023-02-05 10:28:11.000000000 +0100
+++ plasma-framework-5.103.0/src/declarativeimports/platformcomponents/icondialog.cpp 2024-07-04 13:51:23.984025935 +0200
@@ -12,7 +12,9 @@
#include <QVariant>
#include <KIconDialog>
+#ifndef Q_OS_WIN
#include <KX11Extras>
+#endif
#include "utils/sharedsingleton.h"
@@ -36,13 +38,14 @@
dialog->setup(KIconLoader::Desktop);
dialog->setProperty("DoNotCloseController", true);
-
+#ifndef Q_OS_WIN
KX11Extras::setOnAllDesktops(dialog->winId(), true);
-
+#endif
dialog->showDialog();
+#ifndef Q_OS_WIN
KX11Extras::forceActiveWindow(dialog->winId());
-
+#endif
return dialog->openDialog();
}
diff -ur plasma-framework-5.103.0/src/plasma/private/theme_p.cpp plasma-framework-5.103.0/src/plasma/private/theme_p.cpp
--- plasma-framework-5.103.0/src/plasma/private/theme_p.cpp 2023-02-05 10:28:11.000000000 +0100
+++ plasma-framework-5.103.0/src/plasma/private/theme_p.cpp 2024-07-04 13:43:59.965036960 +0200
@@ -22,7 +22,9 @@
#include <KIconTheme>
#include <KSharedConfig>
#include <KWindowEffects>
+#ifndef Q_OS_WIN
#include <KX11Extras>
+#endif
#include <kpluginmetadata.h>
namespace Plasma
@@ -93,7 +95,11 @@
, pixmapCache(nullptr)
, cacheSize(0)
, cachesToDiscard(NoCache)
+#if HAVE_X11
, compositingActive(KX11Extras::self()->compositingActive())
+#else
+ , compositingActive(false)
+#endif
, backgroundContrastActive(KWindowEffects::isEffectAvailable(KWindowEffects::BackgroundContrast))
, isDefault(true)
, useGlobal(true)
@@ -151,7 +157,9 @@
scheduleThemeChangeNotification(PixmapCache | SvgElementsCache);
});
+#if HAVE_X11
connect(KX11Extras::self(), &KX11Extras::compositingChanged, this, &ThemePrivate::compositingChanged);
+#endif
}
ThemePrivate::~ThemePrivate()
diff -ur plasma-framework-5.103.0/src/plasmaquick/dialog.cpp plasma-framework-5.103.0/src/plasmaquick/dialog.cpp
--- plasma-framework-5.103.0/src/plasmaquick/dialog.cpp 2023-02-05 10:28:11.000000000 +0100
+++ plasma-framework-5.103.0/src/plasmaquick/dialog.cpp 2024-07-04 13:47:00.044626620 +0200
@@ -25,7 +25,9 @@
#include <KWindowSystem/KWindowInfo>
#include <KWindowSystem>
+#if HAVE_X11
#include <KX11Extras>
+#endif
#include <kquickaddons/quickviewsharedengine.h>
@@ -268,12 +270,15 @@
theme.backgroundSaturation(),
mask);
+#if HAVE_X11
if (KX11Extras::compositingActive()) {
if (hasMask) {
hasMask = false;
q->setMask(QRegion());
}
- } else {
+ } else
+#endif
+ {
hasMask = true;
q->setMask(frameSvgItem->mask());
}
@@ -906,12 +911,13 @@
}
}
+#if HAVE_X11
if (type == Dialog::Dock || type == Dialog::Notification || type == Dialog::OnScreenDisplay || type == Dialog::CriticalNotification) {
KX11Extras::setOnAllDesktops(q->winId(), true);
} else {
KX11Extras::setOnAllDesktops(q->winId(), false);
}
-
+#endif
#if HAVE_KWAYLAND
if (shellSurface) {
shellSurface->setPanelTakesFocus(!q->flags().testFlag(Qt::WindowDoesNotAcceptFocus));