mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Check if xcb-screensaver extension present
This commit is contained in:
parent
e523492de0
commit
6635d03818
1 changed files with 18 additions and 0 deletions
|
@ -324,6 +324,20 @@ std::optional<xcb_atom_t> 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<xcb_atom_t> GetXCBWMSupported(xcb_connection_t *connection) {
|
||||
auto netWmAtoms = std::vector<xcb_atom_t>{};
|
||||
|
||||
|
@ -398,6 +412,10 @@ std::optional<crl::time> XCBLastUserInputTime() {
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (!IsXCBExtensionPresent(connection, &xcb_screensaver_id)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const auto root = static_cast<xcb_window_t>(reinterpret_cast<quintptr>(
|
||||
native->nativeResourceForIntegration(QByteArray("rootwindow"))));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue