mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't subscribe to inhibiton changes when not supported
This commit is contained in:
parent
f9dd2b4a0a
commit
b4d310fd1e
1 changed files with 39 additions and 42 deletions
|
@ -258,11 +258,6 @@ void GetCapabilities(Fn<void(const QStringList &)> callback) {
|
|||
}
|
||||
|
||||
void GetInhibited(Fn<void(bool)> callback) {
|
||||
if (!CurrentCapabilities.contains(qsl("inhibitions"))) {
|
||||
crl::on_main([=] { callback(false); });
|
||||
return;
|
||||
}
|
||||
|
||||
Noexcept([&] {
|
||||
const auto connection = Gio::DBus::Connection::get_sync(
|
||||
Gio::DBus::BusType::SESSION);
|
||||
|
@ -947,6 +942,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
|
|||
.arg(capabilities.join(", ")));
|
||||
}
|
||||
|
||||
if (capabilities.contains(qsl("inhibitions"))) {
|
||||
Noexcept([&] {
|
||||
_dbusConnection = Gio::DBus::Connection::get_sync(
|
||||
Gio::DBus::BusType::SESSION);
|
||||
|
@ -991,6 +987,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
|
|||
std::string(kPropertiesInterface),
|
||||
"PropertiesChanged",
|
||||
std::string(kObjectPath));
|
||||
}
|
||||
}
|
||||
|
||||
void Manager::Private::showNotification(
|
||||
|
|
Loading…
Add table
Reference in a new issue