GNOME Bugzilla – Bug 771552
Always do something when power button is pressed
Last modified: 2019-01-03 13:04:00 UTC
On computers where suspend is not supported, we should do SOMETHING when the power button is pressed. On Endless, the requirement is to show the interactive power off dialog. That seems like a sensible fallback in any case.
Created attachment 335729 [details] [review] patch
Comment on attachment 335729 [details] [review] patch Oops, it's really broken, let's try again
Created attachment 335736 [details] [review] media-keys: always do something when power button is pressed... ...unless the power button action is actually set to NOTHING. By default, it's set to suspend, but the user's computer might not support suspend. Instead of doing nothing at all, fall back to displaying the interactive shutdown dialog instead. This doesn't require any UI changes, because the control-center option for power button action is now only displayed for computers that do support suspend (since GNOME #764508).
Created attachment 335738 [details] [review] media-keys: always do something when power button is pressed... ...unless the power button action is actually set to NOTHING. By default, it's set to suspend, but the user's computer might not support suspend. Instead of doing nothing at all, fall back to displaying the interactive shutdown dialog instead. This doesn't require any UI changes, because the control-center option for power button action is now only displayed for computers that do support suspend (since GNOME #764508).
Ping
I created https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/72 for this. I changed the code slightly, using g_autoptr for the returned variant and modifying the support check a little bit to avoid code duplication.