mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 08:05:12 +00:00
Initialize Linux lock screen monitor fully asynchronously
This commit is contained in:
@@ -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() {
|
||||||
|
Reference in New Issue
Block a user