diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index f70ef0b947..6f2acd99e8 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -65,6 +65,8 @@ using namespace Platform; using Platform::internal::WaylandIntegration; using Platform::internal::GtkIntegration; +Q_DECLARE_METATYPE(QMargins); + namespace Platform { namespace { @@ -796,24 +798,45 @@ bool ShowWindowMenu(QWindow *window) { } bool SetWindowExtents(QWindow *window, const QMargins &extents) { - if (!IsWayland()) { + if (IsWayland()) { +#ifdef DESKTOP_APP_QT_PATCHED + window->setProperty("WaylandCustomMargins", QVariant::fromValue(extents)); + return true; +#else // DESKTOP_APP_QT_PATCHED + return false; +#endif // !DESKTOP_APP_QT_PATCHED + } else { return SetXCBFrameExtents(window, extents); } - - return false; } bool UnsetWindowExtents(QWindow *window) { - if (!IsWayland()) { + if (IsWayland()) { +#ifdef DESKTOP_APP_QT_PATCHED + window->setProperty("WaylandCustomMargins", QVariant()); + return true; +#else // DESKTOP_APP_QT_PATCHED + return false; +#endif // !DESKTOP_APP_QT_PATCHED + } else { return UnsetXCBFrameExtents(window); } - - return false; } bool WindowsNeedShadow() { - return !IsWayland() - && base::Platform::XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16()); +#ifdef DESKTOP_APP_QT_PATCHED + if (IsWayland()) { + return true; + } +#endif // DESKTOP_APP_QT_PATCHED + + namespace XCB = base::Platform::XCB; + if (!IsWayland() + && XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16())) { + return true; + } + + return false; } Window::ControlsLayout WindowControlsLayout() { diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 346badae70..45e2f03136 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -479,6 +479,8 @@ RUN git submodule update qtbase qtwayland qtimageformats qtsvg WORKDIR qtbase RUN find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply +WORKDIR ../qtwayland +RUN find ../../patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply WORKDIR .. # I couldn't make it work with direct ./configure call :(