From 9e4ffb81a5562223be147c07a8da9516f04d6435 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 25 Oct 2021 07:36:45 +0400 Subject: [PATCH] Re-enable kwayland with Qt 6 --- CMakeLists.txt | 8 +------- ui/platform/linux/ui_linux_wayland_integration.cpp | 14 -------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6769ef..9e88ffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,14 +259,8 @@ elseif(LINUX) target_link_libraries(lib_ui PUBLIC desktop-app::lib_waylandshells + desktop-app::external_kwayland ) - - if (NOT DESKTOP_APP_QT6) - target_link_libraries(lib_ui - PUBLIC - desktop-app::external_kwayland - ) - endif() endif() target_include_directories(lib_ui diff --git a/ui/platform/linux/ui_linux_wayland_integration.cpp b/ui/platform/linux/ui_linux_wayland_integration.cpp index 850494b..01f1e80 100644 --- a/ui/platform/linux/ui_linux_wayland_integration.cpp +++ b/ui/platform/linux/ui_linux_wayland_integration.cpp @@ -24,34 +24,27 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #include -#endif // Qt < 6.0.0 Q_DECLARE_METATYPE(QMargins); using QtWaylandClient::QWaylandIntegration; using QtWaylandClient::QWaylandWindow; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) using namespace KWayland::Client; -#endif // Qt < 6.0.0 namespace Ui { namespace Platform { struct WaylandIntegration::Private { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) std::unique_ptr connection; Registry registry; QEventLoop interfacesLoop; bool interfacesAnnounced = false; -#endif // Qt < 6.0.0 }; WaylandIntegration::WaylandIntegration() : _private(std::make_unique()) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) _private->connection = std::unique_ptr{ ConnectionThread::fromApplication(), }; @@ -74,7 +67,6 @@ WaylandIntegration::WaylandIntegration() _private->interfacesLoop.quit(); } }); -#endif // Qt < 6.0.0 } WaylandIntegration::~WaylandIntegration() = default; @@ -86,21 +78,15 @@ WaylandIntegration *WaylandIntegration::Instance() { } void WaylandIntegration::waitForInterfaceAnnounce() { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) Expects(!_private->interfacesLoop.isRunning()); if (!_private->interfacesAnnounced) { _private->interfacesLoop.exec(); } -#endif // Qt < 6.0.0 } bool WaylandIntegration::xdgDecorationSupported() { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return _private->registry.hasInterface( Registry::Interface::XdgDecorationUnstableV1); -#else // Qt < 6.0.0 - return false; -#endif // Qt >= 6.0.0 } bool WaylandIntegration::windowExtentsSupported() {