diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index a5a827418..fc0638158 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -324,6 +324,20 @@ std::optional GetXCBAtom( return atom; } +bool IsXCBExtensionPresent( + xcb_connection_t *connection, + xcb_extension_t *ext) { + const auto reply = xcb_get_extension_data( + connection, + ext); + + if (!reply) { + return false; + } + + return reply->present; +} + std::vector GetXCBWMSupported(xcb_connection_t *connection) { auto netWmAtoms = std::vector{}; @@ -398,6 +412,10 @@ std::optional XCBLastUserInputTime() { return std::nullopt; } + if (!IsXCBExtensionPresent(connection, &xcb_screensaver_id)) { + return std::nullopt; + } + const auto root = static_cast(reinterpret_cast( native->nativeResourceForIntegration(QByteArray("rootwindow"))));