From a2ff329d2eb893ffae0d1cd18dd76bd494781295 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Wed, 6 Dec 2023 14:39:55 +0100 Subject: Introduce a configure feature for Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the presence of the wayland-client lib as a condition. Fixes: QTBUG-117386 Change-Id: If4336965ea06e3f4b06e9af661efdec38ba46136 Reviewed-by: Tor Arne Vestbø --- src/gui/platform/unix/qgenericunixservices.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/platform/unix/qgenericunixservices.cpp') diff --git a/src/gui/platform/unix/qgenericunixservices.cpp b/src/gui/platform/unix/qgenericunixservices.cpp index 3a289cda452..457981c23fb 100644 --- a/src/gui/platform/unix/qgenericunixservices.cpp +++ b/src/gui/platform/unix/qgenericunixservices.cpp @@ -418,6 +418,7 @@ QByteArray QGenericUnixServices::desktopEnvironment() const template void runWithXdgActivationToken(F &&functionToCall) { +#if QT_CONFIG(wayland) QWindow *window = qGuiApp->focusWindow(); if (!window) { @@ -439,6 +440,9 @@ void runWithXdgActivationToken(F &&functionToCall) &QNativeInterface::Private::QWaylandWindow::xdgActivationTokenCreated, waylandWindow, functionToCall, Qt::SingleShotConnection); waylandWindow->requestXdgActivationToken(waylandApp->lastInputSerial()); +#else + functionToCall({}); +#endif } bool QGenericUnixServices::openUrl(const QUrl &url) -- cgit v1.2.3