Bug 336369 - Lock screen: Add Shut Down and Restart buttons
Summary: Lock screen: Add Shut Down and Restart buttons
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Theme - Breeze (show other bugs)
Version: 5.21.0
Platform: unspecified Linux
: HI wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
: 402318 404876 412212 420283 424088 425617 440897 (view as bug list)
Depends on: 390634
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-18 00:46 UTC by Sebastian Kügler
Modified: 2023-11-18 08:04 UTC (History)
42 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Kügler 2014-06-18 00:46:03 UTC
After waking up the system, the lock screen appears, but doesn't allow putting the machine back to sleep. It rather has the option to shut down, which is a lot more dangerous since it's destructive. A suspend button would be useful here, perhaps more prominent than the shutdown button.

Reproducible: Always
Comment 1 Marco Martin 2014-06-18 10:25:13 UTC
I think related to this, to me it doesn't show *any* option, but if i call the logout screen from kickoff, all correct screens are correctly loaded and work.

so seems that in many cases, the "canSuspend" "canReboot" etc variables in the lock screen qml (those that govern the visibility of the buttons to switch mode) are initialized with wrong values
Comment 2 Sebastian Kügler 2014-06-18 14:22:09 UTC
To me, suspend is missing also when locking from Kickoff.
Comment 3 Marco Martin 2014-06-18 15:06:49 UTC
to me the problem is that is not consistent what options are shown, and it looks like an implementation detail creeping in the ui.
I think there should be some actions always shown, no matter what whas selected on kickoff, or if the dialog is shown in ksmserver or in the lock screen:

* restart
* shutdown
* logout
* switch user (probably atm not possible to show it in ksmserver? but should be made possible maybe in future releases)
* sleep
* hybernate(?)

hiding them if and only if the action is really not possible (due to insufficient permissions, not using a login manager or whatever)
Comment 4 Aleix Pol 2014-07-07 17:15:47 UTC
we don't have switch user, but we have switch session.

I only implemented shutdown because for some reason ksmserver provides a shutdown feature, we can use powerdevil for sleep/hibernate/anything. Also for shutdown too.
Comment 5 Lucas Vinicius Hartmann 2014-10-05 00:55:49 UTC
Same issue here (Kubuntu 14.04).

Suggestion:
1 - Have the lockscreen monitor power state (does DBUS warn of suspend entry/exit?)
2 - On exit suspend the lockscreen should enable 2 suspend options:
2a - Suspend button;
2b - Autosuspend timer (maybe with interval and enable/disable options in the control panel).

Reasoning:
1 - Having the suspend option always enabled would defeat the screen lock. If the user locks his computer "on" then he probably wants it to stay that way.
2 - Enabling the suspen optionson suspend-exit means that theseoptions wouldonly bemade available ifthe computer was already suspended anyway, probably by user request. Allowing manual/automatic return to suspend would only be enforcing a previous choice by the user.
Comment 6 Kai Uwe Broulik 2015-02-16 18:51:36 UTC
We removed the shutdown option and the like due to security reasons, so it doesn't make sense to add a suspend option, I suppose?
Comment 7 Martin Flöser 2015-02-17 06:58:35 UTC
suspend is less dangerous than shutdown (and in opposite to shutdown can work). But exposes some problems: it allows a not logged in user to suspend the system, to suspend other running sessions. We cannot properly determine whether a not logged in user should be allowed to suspend the system. Checking KIOSK for the allowed action doesn't help us as it's for the logged in user.

A possible solution could be introducing a dedicated KIOSK action for suspending from lock screen. This would give the possibility to configure it to be secure for environments where it matters, but gives users the expected comfort.
Comment 8 Lucas Vinicius Hartmann 2015-02-17 10:32:34 UTC
Let the user decide. 

Add three option like "allow suspend/shutdown/hibernate from lock screen" to the configuration dialog. 

Just set defaults to disabled, so that security is not compromised for the careless user.
Comment 9 Martin Flöser 2015-02-17 10:43:24 UTC
adding options is not the correct approach, this is not KDE 3.
Comment 10 Soukyuu 2015-04-30 14:28:38 UTC
This is a problem on laptops where closing the lid suspends and opening it wakes the laptop up. Closing the lid again does nothing, draining the battery. Maybe there is a possibility to detect if the machine was just woken up, allowing to suspend it again in that case only?

Naive approach: suspend sets a flag which enables the suspend button on lockscreen/suspend on closing the lid. This flag is reset once the user has logged in.
Comment 11 Serhiy Zahoriya 2016-01-09 05:49:10 UTC
It's still possible to shutdown the system physically unless it's locked somewhere away from the display and HID devices or it's a remote session. Never seen both IRL, but it's possible, yes (but why leave remote session on and locked?). More, on most systems it's even still possible to both put the machine to sleep or shutdown it by switching to a [locked] TTY console unless these ACPI events are disabled (not the default in most cases, isn't it?). So it looks illogical to me that I can put my laptop to sleep by closing the lid but not by the keyboard shortcut (are there any laptops without a sleep button on the keyboard?).
Comment 12 Martin Flöser 2016-01-11 09:26:49 UTC
For the record: I'm currently working on a solution which would allow to bring suspend back in the next release. I hope I found a way to make it secure.
Comment 13 kolAflash 2016-07-25 09:42:51 UTC
(In reply to Martin Gräßlin from comment #12)
> For the record: I'm currently working on a solution which would allow to
> bring suspend back in the next release. I hope I found a way to make it
> secure.

That would be great!
In KDE 4 i used to have widgets on my lockscreen, allowing me to suspend and hibernate. But in KDE 5 / Plasma 5 this isn't possible anymore.


I don't like to configure my notebook to go to standby if the display is closed. Because I like to put the notebook under my arm and go somewhere else, while the notebook is for example compiling something.

But sometimes I lock my notebook when leaving the office-room without it. And when I come back, I maybe just want to suspend it, because I'm going home with it.
And it's ridiculous, that I have to enter my password just to put the notebook into standby!

In a very general sense of security (NOT regarding the API infrastructure in KDE): Everyone in the room can just take the battery and ac cable out of my notebook to hardly shut it down. And suspend/hibernate are even less worse than a cold shutdown. So there's really no security in protecting theses actions with the users password.
Hibernating may even help if you're not in place and someone else needs to unplug/replug the power cable of your desktop pc. So he can power it down (hibernate) before he unplugs the cable.

Maybe in some scenarios, the ac cable / battery may be not accessible for a user and you want to keep others from suspending/hibernating the machine. So it's maybe wise to make this options configurable.
Comment 14 Emre 2016-10-17 04:32:35 UTC
+1 to this in Arch KDE Plasma 5.8. 
I'm using a Surface Pro 3 without a keyboard (sometimes). I want to be able to suspend and resume without logging in first. This is the default "sane" behavior in Windows.  Power button or shutdown/suspend icons on screen always suspends regardless of lock screen state.
This shall be the default mode in laptops which shall be disabled by an option if more security is required.
Hope there are more users who try to use KDE on laptops!
Comment 15 Nate Graham 2017-12-14 15:04:36 UTC
The screen locker should be able to read the user Preference set in System Settings > Power Management > Energy Saving > "When laptop lid closed". For me on Plasma 5.11.4 it does, so I can suspend my laptop by closing the screen from kscreenlocker. But if the preference there is "Do nothing", or there is no lid because we're not a laptop, then I think adding a suspend button makes sense.
Comment 16 Ian Turner 2018-03-25 11:55:29 UTC
Seems odd to me that I can Switch User -> Shutdown/Suspend/Etc., but not do it directly from the screen locker. Can that be the default behavior? If allowed from the login screen, and switch user is allowed, then also allowed from the lock screen?

Also, if suspend/shutdown/etc., are allowed, would be nice if kscreenlocker5 responded to the relevant ACPI keys as well.
Comment 17 Simone Gaiarin 2018-04-30 05:22:12 UTC
I am also in favour of having a button on the lockscreen to suspend.

Suspending by closing the lid is not enough. For example I configured the action of the laptop lid to do nothing, because I want to close it without suspending when my laptop is docked and connected to a monitor. In this case the lock screen would be shown in the second monitor, and opening and closing the lid would not suspend the laptop.

Moreover I have configured the power button to lock the screen, given that I do it often.

So my only option is to type the password to unlock and suspend, which is very annoying.
Comment 18 Nate Graham 2018-04-30 13:04:57 UTC
The more I think about it, the more I find myself agreeing that we should *at least* have the suspend option available. That's a non-destructive action for all use cases, and will make quite a few people happy given the use cases we've had presented so far.

Other familiar platforms (macOS, Windows, GNOME) also go so far as to allow you to shut down and reboot from the lock screen, even in a multi-user environment. They first display a scary warning declaring "This action may cause you or other logged-in users to lose work. Are you sure you want to proceed?"

We might consider doing something similar, if we warn the user about the potential consequences and only allow it for admin accounts when other users are logged in.
Comment 19 Martin Flöser 2018-04-30 14:58:43 UTC
(In reply to Nate Graham from comment #18)
> The more I think about it, the more I find myself agreeing that we should
> *at least* have the suspend option available. That's a non-destructive
> action for all use cases, and will make quite a few people happy given the
> use cases we've had presented so far.

That is not true. A long running job might get cancelled due to suspend. My example for this is a long calculation in a science department. If we allow suspend a competing researcher might be able to destroy the work of a researcher. If we offer this it must be configurable.

> 
> Other familiar platforms (macOS, Windows, GNOME) also go so far as to allow
> you to shut down and reboot from the lock screen, even in a multi-user
> environment. They first display a scary warning declaring "This action may
> cause you or other logged-in users to lose work. Are you sure you want to
> proceed?"
> 
> We might consider doing something similar, if we warn the user about the
> potential consequences and only allow it for admin accounts when other users
> are logged in.

We cannot. If an application asks to save a document the shutdown is stuck. The screen is locked and it is not possible to interact with the application requiring interaction. That's how session shutdown is guaranteed to work on Linux.
Comment 20 Simone Gaiarin 2018-04-30 16:02:17 UTC
> That is not true. A long running job might get cancelled due to suspend. My
> example for this is a long calculation in a science department. If we allow
> suspend a competing researcher might be able to destroy the work of a
> researcher. If we offer this it must be configurable.

If we make it configurale, I suggest that the default is to allow to suspend. I believe that the users that require this level of security are the minority, so they need to opt-in.

> 
> We cannot. If an application asks to save a document the shutdown is stuck.
> The screen is locked and it is not possible to interact with the application
> requiring interaction. That's how session shutdown is guaranteed to work on
> Linux.

In Linux or in KDE? How does GNOME deal with this?
Comment 21 Martin Flöser 2018-04-30 16:34:32 UTC
(In reply to Simone Gaiarin from comment #20)
> > We cannot. If an application asks to save a document the shutdown is stuck.
> > The screen is locked and it is not possible to interact with the application
> > requiring interaction. That's how session shutdown is guaranteed to work on
> > Linux.
> 
> In Linux or in KDE? How does GNOME deal with this?

In X11 to be precise. See ftp://ftp.x.org/pub/X11R7.0/doc/PDF/xsmp.pdf - how and if GNOME deals with that is at least to me totally irrelevant. What matters to me is the standard we implemented.
Comment 22 kolAflash 2018-06-14 12:06:38 UTC
Side note:
Please add a suspend-to-ram and a suspend-to-disk (if enabled) button. 
Both should be configurable (guess one option for both should be OK).
Comment 23 Holger 2018-10-02 12:21:34 UTC
(In reply to Kai Uwe Broulik from comment #6)
> We removed the shutdown option and the like due to security reasons, so it
> doesn't make sense to add a suspend option, I suppose?

Any pointer to the discussion leading to the removal would be appreciated.

To me it looks like this:
- physical access beats any software = allow power off, suspend / hibernate
- remote session = require password for power off, suspend / hibernate
Comment 24 Sergey 2018-10-23 20:23:25 UTC
agreed with Holger
Comment 25 Nate Graham 2018-12-27 03:10:30 UTC
*** Bug 402318 has been marked as a duplicate of this bug. ***
Comment 26 K Freed 2019-02-22 20:18:14 UTC
Hello everyone, as a Manjaro KDE user, I find it quite annoying when I accidentally turn on my computer, and can’t suspend it within the lock screen. Gnome allows a suspend function, so I don’t see why KDE can’t as well. It gets even more annoying when I accidentally turn on my brother’s computer, because then I have to call him over to login, then suspend his system. Can we either provide an suspend to ram option on the lock screen, or honor the power button as a way to suspend the system while in the lock screen, or both? Gnome allows for either the power button, or the pause button in the top right to be used to suspend the computer while in the lock screen. Even macs allow this. If this is a concern for some who want their computers on all the time, we should provide a “disable suspend while in lock screen,” to keep those people happy.
Comment 27 Jan Przybylak 2019-02-22 20:48:53 UTC
In addition to Buttons I would suggest changing the auto-suspend timer on the lock screen to something short like a minute, or at least giving the user the option to set a different timer for when the system is locked. There is no point to showing the lock screen for an hour or so.
Comment 28 K Freed 2019-02-22 20:57:28 UTC
That would be a nice addition! Please add this functionality KDE devs!s! It would be much appreciated!
Comment 29 K Freed 2019-02-22 20:57:47 UTC
*devs
Comment 30 Nate Graham 2019-03-02 13:58:34 UTC
*** Bug 404876 has been marked as a duplicate of this bug. ***
Comment 31 drohr 2019-05-18 10:45:30 UTC
+1 for this feature!

I suggest to have configurable settings "Show suspend button on lock screen" and "Show shut down / restart buttons on lock screen".
They could be separate due to different severity.
Default could be off, so the current behavior would not change by default.

There are plenty of cases, where this would be convenient:
- PC wakes up randomly.
- Accidentally work up my PC.
- Woke up PC without knowing PW.
- Left PC running to finish some processing and suspend it later.
- Left PC in office and returning to the office quickly just to pick up the laptop.

I do not agree to the security concerns:
1. Default behavior would not change --> I click the box, so I am aware of the risk.
2. I have my password mainly to prevent unauthorized access, not to prevent unauthorized shutdown.
3. Anyone with physical access to the machine does not need the shut down button. He can press the power button / pull the plug / remove the battery / steal it / throw it out of the window / you name it...
4. In the rare case where I really want to prevent shutdown via the button (remote KVM workstation? or whatever), I just do not click the box in the settings.
5. Shutting down / suspending other users' sessions would be prevented by the normal KDE means, just as if I click the power button while I and someone else are logged in.
6. Windows / Gnome / Mac has it without facing major security issues.
Comment 32 Jan Przybylak 2019-07-22 14:24:04 UTC
While I support do the idea of a setting to customize which buttons are shown on the lock screen, I think it would be a viable alternative to just put a 'suspend' or 'cancel' button there. Suspending the system when the escape key is pressed would also be an option (current behaviour is showing the password prompt, which I don't think is a good reaction to pressing escape).
Comment 33 K Freed 2019-07-25 18:41:03 UTC
I love the idea of a cancel button, in which you get to choose either display sleep, suspend, or hibernate. It would be minimalistic and easy.
Comment 34 Nate Graham 2019-10-07 03:20:45 UTC
*** Bug 412212 has been marked as a duplicate of this bug. ***
Comment 35 Anatol Rosch 2020-03-29 11:11:52 UTC
bug 392798 contains a workaround to allow power actions via LockScreenUi.qml .
Comment 36 Nate Graham 2020-04-20 19:14:11 UTC
*** Bug 420283 has been marked as a duplicate of this bug. ***
Comment 37 Patrick Silva 2020-07-11 13:23:44 UTC
*** Bug 424088 has been marked as a duplicate of this bug. ***
Comment 38 Nate Graham 2020-08-21 21:08:34 UTC
*** Bug 425617 has been marked as a duplicate of this bug. ***
Comment 39 soredake 2020-12-27 12:03:24 UTC
Any progress on this?
Comment 40 Nate Graham 2020-12-27 16:07:42 UTC
No, I started working on it but got stuck.
Comment 41 K Freed 2021-03-05 07:18:07 UTC
Any shot at getting something like this for plasma 5.22? It's the last feature I really wish existed in plasma.
Comment 42 David Redondo 2021-08-12 13:54:04 UTC
*** Bug 440897 has been marked as a duplicate of this bug. ***
Comment 43 Krystof Jelinek 2021-08-12 14:00:48 UTC
(In reply to Kai Uwe Broulik from comment #6)
> We removed the shutdown option and the like due to security reasons, so it
> doesn't make sense to add a suspend option, I suppose?

Why? How does that improve security? If I am literally next to the computer, then I can force a complete shutdown by holding down the power button. This does not make any sense...
Comment 44 Nate Graham 2021-08-12 14:02:18 UTC
That's an old argument that nobody still holds. This is going to happen eventually. At the minimum, it's a requirement for Plasma Mobile, and if we do it there, we might as well do it for Plasma Desktop too.
Comment 45 Krystof Jelinek 2021-08-12 14:07:24 UTC
(In reply to Nate Graham from comment #44)
> That's an old argument that nobody still holds. This is going to happen
> eventually. At the minimum, it's a requirement for Plasma Mobile, and if we
> do it there, we might as well do it for Plasma Desktop too.

I am pretty confident that quite a lot of people still hold it, and again I ask: how does it improve security?

What is going to happen eventually? If you are talking about hiding the power options before logging in then again: you can turn off any device by holding down the power button (which might harm the hardware, it's an emergency poweroff), and hopefully, it will remain this way. You should be able to turn any device off when needed, and if you don't want your computer to do that, then you could at least hide the power settings from the GUI - but solving it by disabling it for everyone is the worst way possible.
Comment 46 Nate Graham 2021-08-12 14:17:35 UTC
I mean the requested feature of showing power actions on the lock screen is going to get implemented eventually.
Comment 47 Martin Flöser 2021-08-12 17:15:40 UTC
(In reply to Krystof Jelinek from comment #45)
> I am pretty confident that quite a lot of people still hold it, and again I
> ask: how does it improve security?

As a father of a 3 year old child I can tell you that I am very happy that the lock screen does not provide any destructive actions! It means I can lock the screen and don't have to care what will happen to the system. Editing an important document and tiny hands want to write things: lock the screen. Even the suspend option would be rather destructive as it means downloads, etc. might get cancelled by tiny hands.
Comment 48 Krystof Jelinek 2021-08-12 17:18:04 UTC
(In reply to Nate Graham from comment #46)
> I mean the requested feature of showing power actions on the lock screen is
> going to get implemented eventually.

Oh, sorry about that... there are some people that would probably want that removed as well, so that's the reasoning before my reaction and I apologize for it.
Comment 49 Murz 2021-08-12 19:29:42 UTC
So for satisfy both sides we can make those buttons optional - any who need them will can enable them and use...
Comment 50 Zamundaaa 2021-10-19 08:01:54 UTC
Part of this has been implemented: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1122
To make it sort of more child-proof and secure we can make it optional and maybe add a button on the lockscreen that disables all power options - including "switch user" - until the session has been unlocked.
Ultimately in 99% of situations once phsical access is there it's a futile effort though. For example my cat lately force-shutdown my locked laptop because it's a very nice place to sit...
Comment 51 Nate Graham 2021-10-19 18:06:46 UTC
+1 for optionally disabling these in the KScreenlocker KCM.

Also I think we need to go all the way and add power actions too. :)
Comment 52 K Freed 2022-01-28 06:12:17 UTC
Have the other 2 features been implemented (optional disable and Shutdown/Restart)?

If they haven't i'd love this to be the way it's done

In the screen lock settings:

[X] Enable power these power actions on lock screen
        [X] Sleep
        [X] Restart and Shutdown
                [  ] Require password to restart or shutdown from the lock screen
Comment 53 Murz 2022-01-28 06:29:34 UTC
So, in which release the "Enable power these power actions on lock screen" option is available? I can't find it on my KDE:
Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Comment 54 K Freed 2022-01-31 19:38:58 UTC
It was a suggestion, it is not implemented yet.
Comment 55 Murz 2022-01-31 20:20:15 UTC
Hmm, but the merge request https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1122 is merged, and I don't see the "Sleep" button on 5.23.1 and later releases. Will it land in 5.24 branch only, in February? Can't understand how to quickly look this up in Git repo...
Comment 56 Nate Graham 2022-02-01 03:24:45 UTC
Yes, that's 5.24 only.
Comment 57 Patrick Holthaus 2022-06-23 19:24:28 UTC
Can I please ask (again) for all these options (including hibernate and sleep) to be user configurable?

I do understand that ultimately one cannot prevent people from shutting down a computer if they have physical access to the machine there are some valid use cases where exposing these options are suboptimal, especially when touch screens are involved.

Having the option to hide the functionality decreases the risk for your children to shutdown or put your computer to sleep while important processes are running (they like to touch screens!). Also if you run something in a kiosk mode and need to lock the screen exposing such options is less desirable.

If there's an option to expose media playing, I don't see a problem to not display options for showing shutdown/sleep in the kcm - quite the opposite, I was surprised I didn't find them there.
Comment 58 varysteven 2023-03-03 12:17:47 UTC
I would also like to ask for this to be user configurable. Currently KDE is completely unusable on my family PC. My PC will lock while I'm out for the day, and no one else can use the PC without a forced power down. It's not even a security concern if it's optional. Some people need to be able to shut down, log out, and restart from the lock screen without logging in.