Bug 365100 - Pressing the physical power button is ignored with certain hardware
Summary: Pressing the physical power button is ignored with certain hardware
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.8
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-05 10:09 UTC by Gordan Krešić
Modified: 2023-10-27 14:56 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
From NON working user account (44 bytes, text/plain)
2023-10-24 07:21 UTC, Gordan Krešić
Details
~/.config/kdeglobals from NON working session (6.16 KB, text/plain)
2023-10-24 07:23 UTC, Gordan Krešić
Details
~/.config/kwinrc from NON working session (3.86 KB, text/plain)
2023-10-24 07:24 UTC, Gordan Krešić
Details
~/.config/kglobalshortcutsrc from NON working session (18.72 KB, text/plain)
2023-10-24 07:29 UTC, Gordan Krešić
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gordan Krešić 2016-07-05 10:09:32 UTC
Pressing power button has no effect. No matter which action is configured in System settings -> Power management -> Energy Saving -> When power button pressed, nothing happens.

Checkbox "Button events handling" is checked.

Action for "When laptop lid closed" works ok.

Power button hardware is working properly (tested with xev, sends keycode 124/XF86PowerOff).

According to systemd, PowerDevil is configured to handle events:

gkresic@mata:~$ systemd-inhibit --list
     Who: PowerDevil (UID 1000/gkresic, PID 1338/kded5)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
     Why: KDE handles power events
    Mode: block

     Who: NetworkManager (UID 0/root, PID 869/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

2 inhibitors listed.
gkresic@mata:~$

Reproducible: Always

Steps to Reproduce:
1. Set any action when power button is pressed
2. Press power button


Actual Results:  
Nothing happens.

Expected Results:  
Configured action (suspend, lock screen, ...) should be triggered.
Comment 1 Gordan Krešić 2017-01-02 14:07:35 UTC
Just to confirm that this issue is still reproducible on Plasma 5.8.4.

Other components:

OS: Kubuntu 16.10 (Plasma backported from Kubuntu Backports https://launchpad.net/~kubuntu-ppa/+archive/ubuntu/backports)

KDE Frameworks 5.28.0

Qt 5.6.1

If there are any additional info that I can provide, let me know.
Comment 2 Peter Kreussel 2018-03-09 14:00:06 UTC
Just confirming that this still is the case for me in Plasma 5.12.3., KDE Frameworks 5.43.0, Qt 5.10.1 

Exactly as orig. reporter describes (button working, systemd-inhibit listing PowerDevil)

Sorry, no idea how to help, but would have time, if told how to provide additional info.
Comment 3 Patrick Silva 2018-03-11 02:16:21 UTC
cannot confirm on Arch Linux, plasma 5.12.3. All actions available work.
Comment 4 Gordan Krešić 2018-03-11 10:03:56 UTC
Plasma 5.12.2, Kubuntu 17.10, bug is still here.

I can provide any additional info, if someone tell me what is needed.

Laptop is rather common: ThinkPad T460p.
Comment 5 Gordan Krešić 2018-11-04 15:29:01 UTC
Plasma 5.14.2, issue still present.

Quick research found another reports, but without distinctive resolutions:

https://forum.kde.org/viewtopic.php?f=66&t=153836

https://bbs.archlinux.org/viewtopic.php?id=234466
Comment 6 Nate Graham 2020-07-22 13:58:30 UTC
Probably specific to certain hardware. This worked fine with my former laptop (2016 HP Spectre x360) but does not work with my current laptop (2020 Lenovo ThinkPad X1 Yoga).
Comment 7 Nate Graham 2021-03-28 21:09:05 UTC
So I just realized that with my laptop (same one that I mentioned in the previous comment), just pressing the button is not enough; you have to press it and hold it for a second or so. Given that the button is located on the side of the computer, I suspect that this is actually a hardware behavior designed to keep the button from getting accidentally triggered all the time. For other people experiencing this issue, you might try that to see if it starts working.
Comment 8 Gordan Krešić 2021-03-29 07:33:25 UTC
Press-and-hold is default for many Lenovo devices and I already tested with that in mind.

Like I said in original report "power button hardware is working properly (tested with xev, sends keycode 124/XF86PowerOff).".

Is there a better way besides xev to test if all hardware events are generated properly?
Comment 9 Yaroslav Sidlovsky 2021-04-30 17:37:30 UTC
Related: https://bugs.kde.org/show_bug.cgi?id=434153.
Comment 10 Gordan Krešić 2023-10-21 19:14:09 UTC
This is an old one, but I have an update (note: I'm original reporter of this bug).

It seems this is not related to anything "system-wide", but something with my own session/config. I just reinstalled fresh new Kubuntu 23.10 with KDE Plasma 5.27.8 and copied just my $HOME from old laptop. Power button doesn't work. However, as an experiment, I also created a new user, logged as that new user and... power button was properly handled over there!

Note that my $HOME is quite old (20+ years, dragging stuff back from KDE 3 era), so I guess some of that old config is conflicting with PowerDevil. I tried deleting `~/.config/powermanagementprofilesrc`, but it didn't help. It's obviously something else.

But, now I have working AND non-working sessions and config files, so if anyone is interested in helping me debug this, I'll be glad to experiment. Simply deleting `~/.config` would put me *months* behind in my daily business, so that one is off the table, but anything less that that I'm willing to try.
Comment 11 Nate Graham 2023-10-23 19:11:24 UTC
Thanks for checking in again. Much appreciated.

Can you paste the contents of `~/.config/powerdevilrc`? Also consider attaching ~/.config/kdeglobals and `~/.config/kwinrc` if there's no personally identifying information in there.
Comment 12 Nicolas Fella 2023-10-23 19:12:36 UTC
also .config/kglobalshortcutsrc
Comment 13 Gordan Krešić 2023-10-24 07:21:24 UTC
Created attachment 162528 [details]
From NON working user account
Comment 14 Gordan Krešić 2023-10-24 07:23:15 UTC
Created attachment 162529 [details]
~/.config/kdeglobals from NON working session
Comment 15 Gordan Krešić 2023-10-24 07:24:55 UTC
Created attachment 162530 [details]
~/.config/kwinrc from NON working session
Comment 16 Gordan Krešić 2023-10-24 07:29:20 UTC
Created attachment 162531 [details]
~/.config/kglobalshortcutsrc from NON working session
Comment 17 Gordan Krešić 2023-10-24 07:33:33 UTC
Nate && Nicolas, thanks for prompt response. I've attached requested files from NON-working user account. Tell me if you need ones from working one (it's default what you get on Kubuntu 23.10, so probably not that interesting).

Quickly glancing between those files from different user accounts, I did found differences in `~/.config/kglobalshortcutsrc` in `[org_kde_powerdevil]` section. Of course, I have no idea if that may be the culprit of this problem.

Once again, thanks for your assistance.
Comment 18 Nate Graham 2023-10-24 18:54:55 UTC
In the powerdevil group of the kglobalshortcutsrc file, this looks suspicious to me:

PowerDown=Power Down,Power Down,Power Down
PowerOff=none,Power Off,Power Off

On my system, it's set like this:

PowerDown=Power Down,Power Down,Power Down
PowerOff=Power Off,Power Off,Power Off
Comment 19 Gordan Krešić 2023-10-27 07:29:18 UTC
(In reply to Nate Graham from comment #18)
> In the powerdevil group of the kglobalshortcutsrc file, this looks
> suspicious to me:
> 
> PowerDown=Power Down,Power Down,Power Down
> PowerOff=none,Power Off,Power Off
> 
> On my system, it's set like this:
> 
> PowerDown=Power Down,Power Down,Power Down
> PowerOff=Power Off,Power Off,Power Off

This did it!

Thanks Nate.
Comment 20 Nate Graham 2023-10-27 14:56:17 UTC
Excellent. :) I guess it always was some old stale config from over 7 years ago that current code no longer supports.