After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771552 - Always do something when power button is pressed
Always do something when power button is pressed
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: media-keys
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2016-09-16 18:06 UTC by Michael Catanzaro
Modified: 2019-01-03 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.17 KB, patch)
2016-09-16 18:06 UTC, Michael Catanzaro
none Details | Review
media-keys: always do something when power button is pressed... (4.19 KB, patch)
2016-09-16 20:58 UTC, Michael Catanzaro
none Details | Review
media-keys: always do something when power button is pressed... (4.28 KB, patch)
2016-09-16 22:22 UTC, Michael Catanzaro
none Details | Review

Description Michael Catanzaro 2016-09-16 18:06:09 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.
Comment 1 Michael Catanzaro 2016-09-16 18:06:27 UTC
Created attachment 335729 [details] [review]
patch
Comment 2 Michael Catanzaro 2016-09-16 19:01:31 UTC
Comment on attachment 335729 [details] [review]
patch

Oops, it's really broken, let's try again
Comment 3 Michael Catanzaro 2016-09-16 20:58:11 UTC
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).
Comment 4 Michael Catanzaro 2016-09-16 22:22:03 UTC
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).
Comment 5 Michael Catanzaro 2018-12-31 19:18:37 UTC
Ping
Comment 6 Benjamin Berg 2019-01-03 13:04:00 UTC
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.