Skip to content

Commit 24847d4

Browse files
committed
power applet: Retry the power daemon when it becomes active.
In wayland sessions, csd-power is not necessarily online in time for the applet, and the brightness slider is disabled. Watch for an owner and re-check when it appears.
1 parent 131b054 commit 24847d4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • files/usr/share/cinnamon/applets/power@cinnamon.org

files/usr/share/cinnamon/applets/power@cinnamon.org/applet.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ class BrightnessSlider extends PopupMenu.PopupSliderMenuItem {
133133
this._readyCallback();
134134
}
135135

136+
// The proxy can resolve before csd-power has claimed its bus name during
137+
// session startup, in which case these calls fail with ServiceUnknown and
138+
// the slider would stay hidden forever. Re-query whenever the service
139+
// appears so we recover once csd-power is up.
140+
this.proxy.connect("notify::g-name-owner", this._serviceAppeared.bind(this));
141+
this._serviceAppeared();
142+
}
143+
144+
_serviceAppeared() {
145+
if (this.proxy.g_name_owner == null)
146+
return;
147+
136148
this.proxy.GetPercentageRemote((b, error) => {
137149
if (error)
138150
return;

0 commit comments

Comments
 (0)