GNOME Bugzilla – Bug 657496
Handle "soft" power button differently from hard one
Last modified: 2019-03-20 10:55:14 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.
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).
This still isn't fixed, because ACPI sucks. We should still be able to do it on devices which don't use ACPI.
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.
(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.
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.
-- 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.