mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Initialize Linux lock screen monitor fully asynchronously
This commit is contained in:
parent
5b62d97288
commit
a66b886c51
1 changed files with 13 additions and 9 deletions
|
@ -180,7 +180,7 @@ gi::ref_ptr<Application> MakeApplication() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LinuxIntegration final : public Integration {
|
class LinuxIntegration final : public Integration, public base::has_weak_ptr {
|
||||||
public:
|
public:
|
||||||
LinuxIntegration();
|
LinuxIntegration();
|
||||||
|
|
||||||
|
@ -200,13 +200,6 @@ private:
|
||||||
|
|
||||||
LinuxIntegration::LinuxIntegration()
|
LinuxIntegration::LinuxIntegration()
|
||||||
: _application(MakeApplication())
|
: _application(MakeApplication())
|
||||||
, _inhibitProxy(
|
|
||||||
XdpInhibit::InhibitProxy::new_for_bus_sync(
|
|
||||||
Gio::BusType::SESSION_,
|
|
||||||
Gio::DBusProxyFlags::DO_NOT_AUTO_START_AT_CONSTRUCTION_,
|
|
||||||
base::Platform::XDP::kService,
|
|
||||||
base::Platform::XDP::kObjectPath,
|
|
||||||
nullptr))
|
|
||||||
, _darkModeWatcher(
|
, _darkModeWatcher(
|
||||||
"org.freedesktop.appearance",
|
"org.freedesktop.appearance",
|
||||||
"color-scheme",
|
"color-scheme",
|
||||||
|
@ -230,7 +223,18 @@ LinuxIntegration::LinuxIntegration()
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxIntegration::init() {
|
void LinuxIntegration::init() {
|
||||||
initInhibit();
|
XdpInhibit::InhibitProxy::new_for_bus(
|
||||||
|
Gio::BusType::SESSION_,
|
||||||
|
Gio::DBusProxyFlags::NONE_,
|
||||||
|
base::Platform::XDP::kService,
|
||||||
|
base::Platform::XDP::kObjectPath,
|
||||||
|
crl::guard(this, [=](GObject::Object, Gio::AsyncResult res) {
|
||||||
|
_inhibitProxy = XdpInhibit::InhibitProxy::new_for_bus_finish(
|
||||||
|
res,
|
||||||
|
nullptr);
|
||||||
|
|
||||||
|
initInhibit();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinuxIntegration::initInhibit() {
|
void LinuxIntegration::initInhibit() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue