diff options
author | David Redondo <qt@david-redondo.de> | 2023-12-06 14:39:55 +0100 |
---|---|---|
committer | David Redondo <qt@david-redondo.de> | 2023-12-07 23:04:59 +0100 |
commit | a2ff329d2eb893ffae0d1cd18dd76bd494781295 (patch) | |
tree | de023474c2be76a63891b30046006f6289101f1f /src/gui | |
parent | 6866e6f2fa1cfa8f91a940936296d3ecb5317640 (diff) |
Introduce a configure feature for Wayland
Using the presence of the wayland-client lib as a condition.
Fixes: QTBUG-117386
Change-Id: If4336965ea06e3f4b06e9af661efdec38ba46136
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/configure.cmake | 8 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_platform.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qplatformscreen_p.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qplatformwindow_p.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/platform/unix/qgenericunixservices.cpp | 4 | ||||
-rw-r--r-- | src/gui/platform/unix/qunixnativeinterface.cpp | 4 |
9 files changed, 22 insertions, 12 deletions
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 02601dc9c6..52b85a1db8 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -62,6 +62,7 @@ qt_find_package(WrapVulkanHeaders PROVIDED_TARGETS WrapVulkanHeaders::WrapVulkan MODULE_NAME gui QMAKE_LIB vulkan MARK_OPTIONAL) if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(Wayland PROVIDED_TARGETS Wayland::Server MODULE_NAME gui QMAKE_LIB wayland_server) + qt_find_package(Wayland PROVIDED_TARGETS Wayland::Client MODULE_NAME gui QMAKE_LIB wayland_client) endif() if((X11_SUPPORTED) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(X11 PROVIDED_TARGETS X11::X11 MODULE_NAME gui QMAKE_LIB xlib) @@ -863,7 +864,7 @@ qt_feature("eglfs_rcar" PRIVATE ) qt_feature("eglfs_viv_wl" PRIVATE LABEL "EGLFS i.Mx6 Wayland" - CONDITION QT_FEATURE_eglfs_viv AND Wayland_FOUND + CONDITION QT_FEATURE_eglfs_viv AND TARGET Wayland::Server ) qt_feature("eglfs_openwfd" PRIVATE LABEL "EGLFS OpenWFD" @@ -1243,6 +1244,11 @@ qt_feature("graphicsframecapture" PRIVATE CONDITION TEST_renderdoc OR (MACOS OR IOS) ) qt_feature_definition("undogroup" "QT_NO_UNDOGROUP" NEGATE VALUE "1") +qt_feature("wayland" PUBLIC + SECTION "Platform plugins" + LABEL "Wayland" + CONDITION TARGET Wayland::Client +) qt_configure_add_summary_section(NAME "Qt Gui") qt_configure_add_summary_entry(ARGS "accessibility") qt_configure_add_summary_entry(ARGS "freetype") diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index df141c4e32..c7ae7aaae1 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -4386,7 +4386,7 @@ void *QGuiApplication::resolveInterface(const char *name, int revision) const #if QT_CONFIG(xcb) QT_NATIVE_INTERFACE_RETURN_IF(QX11Application, platformNativeInterface()); #endif -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) QT_NATIVE_INTERFACE_RETURN_IF(QWaylandApplication, platformNativeInterface()); #endif diff --git a/src/gui/kernel/qguiapplication_platform.h b/src/gui/kernel/qguiapplication_platform.h index b6182e42a3..545bf75c84 100644 --- a/src/gui/kernel/qguiapplication_platform.h +++ b/src/gui/kernel/qguiapplication_platform.h @@ -23,7 +23,7 @@ typedef struct _XDisplay Display; struct xcb_connection_t; #endif -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) struct wl_display; struct wl_compositor; struct wl_seat; @@ -46,7 +46,7 @@ struct Q_GUI_EXPORT QX11Application }; #endif -#if defined(Q_OS_UNIX) || defined(Q_CLANG_QDOC) +#if QT_CONFIG(wayland) || defined(Q_QDOC) struct Q_GUI_EXPORT QWaylandApplication { QT_DECLARE_NATIVE_INTERFACE(QWaylandApplication, 1, QGuiApplication) diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h index e871fc16c8..2cbc75af77 100644 --- a/src/gui/kernel/qplatformscreen_p.h +++ b/src/gui/kernel/qplatformscreen_p.h @@ -24,7 +24,7 @@ #include <qwindowdefs_win.h> #endif -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) struct wl_output; #endif @@ -84,7 +84,7 @@ struct Q_GUI_EXPORT QWindowsScreen }; #endif -#if defined(Q_OS_UNIX) || defined(Q_CLANG_QDOC) +#if QT_CONFIG(wayland) || defined(Q_QDOC) struct Q_GUI_EXPORT QWaylandScreen { QT_DECLARE_NATIVE_INTERFACE(QWaylandScreen, 1, QScreen) diff --git a/src/gui/kernel/qplatformwindow_p.h b/src/gui/kernel/qplatformwindow_p.h index 7d3f2f641c..e24f983975 100644 --- a/src/gui/kernel/qplatformwindow_p.h +++ b/src/gui/kernel/qplatformwindow_p.h @@ -21,7 +21,7 @@ #include <QtCore/qnativeinterface.h> #include <QtGui/qwindow.h> -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) #include <any> #include <QtCore/qobject.h> @@ -106,7 +106,7 @@ struct Q_GUI_EXPORT QWindowsWindow }; #endif // Q_OS_WIN -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) struct Q_GUI_EXPORT QWaylandWindow : public QObject { Q_OBJECT diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index d598e4fc54..c5863d1463 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -732,7 +732,7 @@ void *QScreen::resolveInterface(const char *name, int revision) const QT_NATIVE_INTERFACE_RETURN_IF(QAndroidScreen, platformScreen); #endif -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) QT_NATIVE_INTERFACE_RETURN_IF(QWaylandScreen, platformScreen); #endif diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 9de6148046..57fe8fa287 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -3129,7 +3129,7 @@ void *QWindow::resolveInterface(const char *name, int revision) const QT_NATIVE_INTERFACE_RETURN_IF(QCocoaWindow, platformWindow); #endif -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) QT_NATIVE_INTERFACE_RETURN_IF(QWaylandWindow, platformWindow); #endif diff --git a/src/gui/platform/unix/qgenericunixservices.cpp b/src/gui/platform/unix/qgenericunixservices.cpp index 3a289cda45..457981c23f 100644 --- a/src/gui/platform/unix/qgenericunixservices.cpp +++ b/src/gui/platform/unix/qgenericunixservices.cpp @@ -418,6 +418,7 @@ QByteArray QGenericUnixServices::desktopEnvironment() const template<typename F> 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) diff --git a/src/gui/platform/unix/qunixnativeinterface.cpp b/src/gui/platform/unix/qunixnativeinterface.cpp index 82da2df96a..cf212c1740 100644 --- a/src/gui/platform/unix/qunixnativeinterface.cpp +++ b/src/gui/platform/unix/qunixnativeinterface.cpp @@ -231,7 +231,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QEvdevKeyMapper); #endif // QT_CONFIG(evdev) -#if defined(Q_OS_UNIX) +#if QT_CONFIG(wayland) /*! \class QNativeInterface::QWaylandApplication @@ -301,6 +301,6 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWaylandScreen); QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWaylandWindow); -#endif // Q_OS_UNIX +#endif // QT_CONFIG(wayland) QT_END_NAMESPACE |