File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments