From f66cfb5684932a5da51a40f3c586dec315c8a1ea Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 28 Dec 2020 05:58:42 +0400 Subject: [PATCH] Use new IsSupportedByWM XCB API from lib_base --- .../platform/linux/specific_linux.cpp | 48 ++----------------- Telegram/lib_base | 2 +- 2 files changed, 5 insertions(+), 45 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index e4146ab143..5ffe8a1e03 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -451,25 +451,6 @@ bool ShowXCBWindowMenu(QWindow *window) { return true; } -bool XCBFrameExtentsSupported() { - const auto connection = base::Platform::XCB::GetConnectionFromQt(); - if (!connection) { - return false; - } - - const auto frameExtentsAtom = base::Platform::XCB::GetAtom( - connection, - kXCBFrameExtentsAtomName.utf16()); - - if (!frameExtentsAtom.has_value()) { - return false; - } - - return ranges::contains( - base::Platform::XCB::GetWMSupported(connection), - *frameExtentsAtom); -} - bool SetXCBFrameExtents(QWindow *window, const QMargins &extents) { const auto connection = base::Platform::XCB::GetConnectionFromQt(); if (!connection) { @@ -526,25 +507,6 @@ bool UnsetXCBFrameExtents(QWindow *window) { return true; } -bool XCBSkipTaskbarSupported() { - const auto connection = base::Platform::XCB::GetConnectionFromQt(); - if (!connection) { - return false; - } - - const auto skipTaskbarAtom = base::Platform::XCB::GetAtom( - connection, - "_NET_WM_STATE_SKIP_TASKBAR"); - - if (!skipTaskbarAtom.has_value()) { - return false; - } - - return ranges::contains( - base::Platform::XCB::GetWMSupported(connection), - *skipTaskbarAtom); -} - Window::Control GtkKeywordToWindowControl(const QString &keyword) { if (keyword == qstr("minimize")) { return Window::Control::Minimize; @@ -804,7 +766,8 @@ bool TrayIconSupported() { } bool SkipTaskbarSupported() { - return !IsWayland() && XCBSkipTaskbarSupported(); + return !IsWayland() + && base::Platform::XCB::IsSupportedByWM("_NET_WM_STATE_SKIP_TASKBAR"); } bool StartSystemMove(QWindow *window) { @@ -848,11 +811,8 @@ bool UnsetWindowExtents(QWindow *window) { } bool WindowsNeedShadow() { - if (!IsWayland() && XCBFrameExtentsSupported()) { - return true; - } - - return false; + return !IsWayland() + && base::Platform::XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16()); } Window::ControlsLayout WindowControlsLayout() { diff --git a/Telegram/lib_base b/Telegram/lib_base index b0b13dc609..dc89f34be5 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit b0b13dc6098f62fcf58087e2a0987de3af55ae3f +Subproject commit dc89f34be5387bef731c59aeca3ca201e042ecc3