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 657496 - Handle "soft" power button differently from hard one
Handle "soft" power button differently from hard one
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: media-keys
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-27 11:50 UTC by Bastien Nocera
Modified: 2019-03-20 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2011-08-27 11:50:26 UTC
On device which have a soft power button, we should be able to show a "shut down, really?" dialogue instead of shutting down on long presses.
Comment 1 Benjamin Berg 2017-06-13 11:58:23 UTC
I think this is NOTABUG or has been fixed long ago.

gnome-settings-daemon is handling the power button these days (defaulting to suspend in /org/gnome/settings-daemon/plugins/power/power-button-action).

There are some other issues throughout the stack though (i.e. many Lenovo laptops are currently broken because the kernel does not receive the ACPI event).
Comment 2 Bastien Nocera 2017-06-13 12:01:42 UTC
This still isn't fixed, because ACPI sucks. We should still be able to do it on devices which don't use ACPI.
Comment 3 Benjamin Berg 2017-06-13 12:36:00 UTC
Shouldn't all devices with a soft power button cause the KEY_POWER evdev key to be delivered (both ACPI and non-ACPI keys)? In that case gnome-settings-daemon will do the right thing, so I would consider this a kernel issue rather than a gnome-settings-daemon one.
Comment 4 Bastien Nocera 2017-06-13 13:04:28 UTC
(In reply to Benjamin Berg from comment #3)
> In that case
> gnome-settings-daemon will do the right thing, so I would consider this a
> kernel issue rather than a gnome-settings-daemon one.

No, it won't, because gnome-settings-daemon needs to handle a long press of the button on devices that don't just switch off like ATX power supplies.

Try holding the power button on your phone and your laptop, and see the difference in behaviour. We want that.
Comment 5 Benjamin Berg 2017-06-13 13:12:51 UTC
Ah, what you are going for here is detecting long presses of the power button and handling those different from short presses.

So something like:
 * Short press suspends the machine (the current action)
 * Press >1 second shows the shutdown dialog

So basically to implement this we would need to register a timeout in the press handler and start the action either when the timeout is reached or when the button is released again before it times out.
Comment 6 GNOME Infrastructure Team 2019-03-20 10:55:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/174.