Decrease indentation in XCBLastUserInputTime

This commit is contained in:
Ilya Fedin 2020-08-17 09:54:03 +04:00 committed by John Preston
parent d02092f09e
commit eaae7b1d03

View file

@ -386,7 +386,11 @@ std::vector<xcb_atom_t> GetXCBWMSupported(xcb_connection_t *connection) {
}
std::optional<crl::time> XCBLastUserInputTime() {
if (const auto native = QGuiApplication::platformNativeInterface()) {
const auto native = QGuiApplication::platformNativeInterface();
if (!native) {
return std::nullopt;
}
const auto connection = reinterpret_cast<xcb_connection_t*>(
native->nativeResourceForIntegration(QByteArray("connection")));
@ -394,16 +398,12 @@ std::optional<crl::time> XCBLastUserInputTime() {
return std::nullopt;
}
const auto screen = xcb_setup_roots_iterator(
xcb_get_setup(connection)).data;
if (!screen) {
return std::nullopt;
}
const auto root = static_cast<xcb_window_t>(reinterpret_cast<quintptr>(
native->nativeResourceForIntegration(QByteArray("rootwindow"))));
const auto cookie = xcb_screensaver_query_info(
connection,
screen->root);
root);
auto reply = xcb_screensaver_query_info_reply(
connection,
@ -420,9 +420,6 @@ std::optional<crl::time> XCBLastUserInputTime() {
return (crl::now() - static_cast<crl::time>(idle));
}
return std::nullopt;
}
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
std::optional<crl::time> FreedesktopDBusLastUserInputTime() {
static auto NotSupported = false;