Skip to content

Commit 86eef33

Browse files
committed
[email protected]: Fix screensaver and switch-user activation.
ref: 3fa32cb
1 parent f15d635 commit 86eef33

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

files/usr/share/cinnamon/applets/[email protected]/applet.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,22 @@ class CinnamonUserApplet extends Applet.TextApplet {
7878

7979
item = new PopupMenu.PopupIconMenuItem(_("Lock Screen"), "xsi-lock-screen", St.IconType.SYMBOLIC);
8080
item.connect('activate', Lang.bind(this, function() {
81-
Main.lockScreen(true);
81+
Main.screensaverController.lockScreen(true);
8282
}));
8383
this.menu.addMenuItem(item);
8484

8585
if (!Main.lockdownSettings.get_boolean('disable-user-switching')) {
8686
item = new PopupMenu.PopupIconMenuItem(_("Switch User"), "xsi-switch-user", St.IconType.SYMBOLIC);
8787
item.connect('activate', Lang.bind(this, function() {
88-
Main.lockScreen(false);
89-
Util.switchToGreeter();
88+
let lockedId = Main.screensaverController.connect("locked-changed", () => {
89+
Util.switchToGreeter();
90+
Main.screensaverController.disconnect(lockedId);
91+
})
92+
93+
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
94+
Main.screensaverController.lockScreen(false);
95+
return GLib.SOURCE_REMOVE;
96+
});
9097
}));
9198
this.menu.addMenuItem(item);
9299
}

0 commit comments

Comments
 (0)