summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/qgenericunixservices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/platform/unix/qgenericunixservices.cpp')
-rw-r--r--src/gui/platform/unix/qgenericunixservices.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/gui/platform/unix/qgenericunixservices.cpp b/src/gui/platform/unix/qgenericunixservices.cpp
index 34d9c37e24..bfd2556b1e 100644
--- a/src/gui/platform/unix/qgenericunixservices.cpp
+++ b/src/gui/platform/unix/qgenericunixservices.cpp
@@ -354,9 +354,13 @@ private Q_SLOTS:
{
if (result != 0)
return;
- XDGDesktopColor color{};
- map.value(u"color"_s).value<QDBusArgument>() >> color;
- Q_EMIT colorPicked(color.toQColor());
+ if (map.contains(u"color"_s)) {
+ XDGDesktopColor color{};
+ map.value(u"color"_s).value<QDBusArgument>() >> color;
+ Q_EMIT colorPicked(color.toQColor());
+ } else {
+ Q_EMIT colorPicked({});
+ }
deleteLater();
}
@@ -418,9 +422,11 @@ QByteArray QGenericUnixServices::desktopEnvironment() const
template<typename F>
void runWithXdgActivationToken(F &&functionToCall)
{
+#if QT_CONFIG(wayland)
QWindow *window = qGuiApp->focusWindow();
if (!window) {
+ functionToCall({});
return;
}
@@ -430,13 +436,17 @@ void runWithXdgActivationToken(F &&functionToCall)
dynamic_cast<QNativeInterface::Private::QWaylandWindow *>(window->handle());
if (!waylandWindow || !waylandApp) {
+ functionToCall({});
return;
}
- waylandWindow->requestXdgActivationToken(waylandApp->lastInputSerial());
QObject::connect(waylandWindow,
&QNativeInterface::Private::QWaylandWindow::xdgActivationTokenCreated,
waylandWindow, functionToCall, Qt::SingleShotConnection);
+ waylandWindow->requestXdgActivationToken(waylandApp->lastInputSerial());
+#else
+ functionToCall({});
+#endif
}
bool QGenericUnixServices::openUrl(const QUrl &url)
@@ -554,9 +564,7 @@ QPlatformServiceColorPicker *QGenericUnixServices::colorPicker(QWindow *parent)
QString QGenericUnixServices::portalWindowIdentifier(QWindow *window)
{
- if (QGuiApplication::platformName() == QLatin1String("xcb"))
- return "x11:"_L1 + QString::number(window->winId(), 16);
-
+ Q_UNUSED(window);
return QString();
}