From 0536a479f91beb9954393e1301e9e42be6abe724 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 1 Oct 2020 16:58:05 +0400 Subject: [PATCH] Use startSystemMove/startSystemResize instead of platform code on Wayland with Qt 5.15 --- .../SourceFiles/platform/linux/specific_linux.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 2a8cf2e9f9..ba82674372 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -628,6 +628,8 @@ bool StartXCBMoveResize(QWindow *window, int edges) { } bool StartWaylandMove(QWindow *window) { + // There are startSystemMove on Qt 5.15 +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED if (const auto waylandWindow = static_cast( window->handle())) { if (const auto seat = waylandWindow->display()->lastInputDevice()) { @@ -636,27 +638,29 @@ bool StartWaylandMove(QWindow *window) { } } } +#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED return false; } bool StartWaylandResize(QWindow *window, Qt::Edges edges) { + // There are startSystemResize on Qt 5.15 +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED if (const auto waylandWindow = static_cast( window->handle())) { if (const auto seat = waylandWindow->display()->lastInputDevice()) { if (const auto shellSurface = waylandWindow->shellSurface()) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) || defined DESKTOP_APP_QT_PATCHED - return shellSurface->resize(seat, edges); -#elif QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) || defined DESKTOP_APP_QT_PATCHED // Qt >= 5.15 || DESKTOP_APP_QT_PATCHED +#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) shellSurface->resize(seat, edges); return true; -#else // Qt >= 5.13 || DESKTOP_APP_QT_PATCHED +#else // Qt >= 5.13 shellSurface->resize(seat, WlResizeFromEdges(edges)); return true; -#endif // Qt < 5.13 && !DESKTOP_APP_QT_PATCHED +#endif // Qt < 5.13 } } } +#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED return false; }