Bug 493546 - Power actions after inactivity are not triggered on the Fedora X11 session
Summary: Power actions after inactivity are not triggered on the Fedora X11 session
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Powerdevil
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 6.1.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 493765 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-09-23 19:27 UTC by Garry Williams
Modified: 2024-10-02 02:08 UTC (History)
8 users (show)

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


Attachments
Do Nothing, Sleep, Shut Down (133.62 KB, image/png)
2024-09-25 01:16 UTC, Garry Williams
Details
plasma-6.1.90 setting power management (479.16 KB, image/png)
2024-09-28 05:25 UTC, Aaron.Ma
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Garry Williams 2024-09-23 19:27:16 UTC
SUMMARY
After a recent update, the display will not turn off on inactivity.  I see no setting to allow such a thing.  This is a regression.

STEPS TO REPRODUCE
1.  Let system remain idle for a long time, say one hour.
2. 
3. 

OBSERVED RESULT
Display never turns off

EXPECTED RESULT
Display should turn off (it used to before a recent update)

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.10.11-200.fc40.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Dell Inc.
Product Name: XPS 13 9370

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-09-24 04:27:13 UTC
Can you attach a screenshot of what the Power Management page in System Settings looks like for you?
Comment 2 Garry Williams 2024-09-25 01:16:21 UTC
Created attachment 174052 [details]
Do Nothing, Sleep, Shut Down
Comment 3 Natalie Clarius 2024-09-25 02:26:03 UTC
I can't reproduce it.

Do you have automatic screen locking enabled in Screen Locking settings, if so after after how much time?
Comment 4 Garry Williams 2024-09-25 02:45:43 UTC
(In reply to Natalie Clarius from comment #3)
> Do you have automatic screen locking enabled in Screen Locking settings,

No.  It's set to "Never".

(I do have lock after sleep checked, but that probably is not relevant.)
Comment 5 Natalie Clarius 2024-09-25 15:12:41 UTC
Do the other settings take effect, such as the dimming?
Comment 6 Garry Williams 2024-09-25 19:05:42 UTC
(In reply to Natalie Clarius from comment #5)
> Do the other settings take effect, such as the dimming?

Both "Change keyboard brightness" and "Change screen brightness" work as expected.

The problem seems to be no place to specify turn off on idle.  I see no setting for that.
Comment 7 Garry Williams 2024-09-25 19:12:22 UTC
In a f39 system I see a checkbox labeled "Screen Energy Saving" along with a edit box for selecting how many minutes which is labeled "Switch off after".  There is nothing that I can see in f40 that is the same or similar.
Comment 8 Natalie Clarius 2024-09-28 04:49:25 UTC
*** Bug 493765 has been marked as a duplicate of this bug. ***
Comment 9 Natalie Clarius 2024-09-28 04:52:44 UTC
Your screenshot above shows the "Turn off screen" setting under "Display and Brightness", set to after 10 and 1 minutes for unlocked and locked respectively. This is the setting you're talking about, no? I am a little confused as to what you mean by not seeing the right setting.
Comment 10 Aaron.Ma 2024-09-28 05:25:59 UTC
Created attachment 174163 [details]
plasma-6.1.90 setting power management
Comment 11 Aaron.Ma 2024-09-28 05:29:29 UTC
set "power button" to "turn off screen", press power button then the screen is turned off.
Comment 12 Aaron.Ma 2024-09-28 05:32:26 UTC
Also there is a coredump repeated in journal log:

systemd-coredump[19988]: [🡕] Process 19979 (chargethreshold) of user 0 dumped core.
Comment 13 S. Umar 2024-09-28 12:01:42 UTC
I can confirm this on six workstations and my laptop, all on Fedora 40, running plasma-desktop 6.1.5, framework 6.6.0. There are some patches I see in powerdevil but not yet applied downstream. My power settings are same as the one reported here. I saw that once in
a while after a reboot it works on some workstations (all have same setup and graphics card). If I logout to sddm then it works fine.
Perhaps a race condition. I saw these that may be related:
https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/8277adb7cd89293fd4d32407eee1596ffbf6acce
https://invent.kde.org/plasma/powerdevil/-/merge_requests/425
Comment 14 Erik Duisters 2024-09-28 12:05:21 UTC
I have the same issue, running Fedora Core 40
Plasma: 6.1.5
Frameworks: 6.6.0
Qt: 6.7.2

Running Xorg

Both screen dimming and turning off screen stopped working a week ago after kde and qt updates
Comment 15 Garry Williams 2024-09-29 15:07:55 UTC
(In reply to Natalie Clarius from comment #9)
> Your screenshot above shows the "Turn off screen" setting under "Display and
> Brightness", set to after 10 and 1 minutes for unlocked and locked
> respectively. This is the setting you're talking about, no? I am a little
> confused as to what you mean by not seeing the right setting.

Look at f39.  The needed setting ("Screen Energy Saving") is missing in f40.  It used to turn off.  After update, it will never turn off.

("Display and Brightness" does not allow screen to turn off on idle.)

Please compare f39 with f40.
Comment 16 Natalie Clarius 2024-09-29 15:17:13 UTC
(In reply to Garry Williams from comment #15)
> 
> Please compare f39 with f40.

What do you mean by f39 and f40? I assume https://bugsfiles.kde.org/attachment.cgi?id=174052is one of the things you're referring to? What's the other one?

(In reply to Garry Williams from comment #15)
> (In reply to Natalie Clarius from comment #9)
> > Your screenshot above shows the "Turn off screen" setting under "Display and
> > Brightness", set to after 10 and 1 minutes for unlocked and locked
> > respectively. This is the setting you're talking about, no? I am a little
> > confused as to what you mean by not seeing the right setting.
> 
> Look at f39.  The needed setting ("Screen Energy Saving") is missing in f40.
> It used to turn off.  After update, it will never turn off.
> 
> ("Display and Brightness" does not allow screen to turn off on idle.)

"Turn off screen" in the "Display and Brightness" section is the setting that is supposed to turn off the screen on idle.
Comment 17 Garry Williams 2024-09-29 20:30:39 UTC
(In reply to Natalie Clarius from comment #16)
> (In reply to Garry Williams from comment #15)
> What do you mean by f39 and f40?

On my Fedora 39 (f39) system (KDE Plasma Version 5.27.11), there is a setting section labeled "Screen Energy Saving".  That setting controlled the screen turn off on idle.  On my Fedora 40 (f40) system (KDE Plasma Version 6.1.5), that section is removed.  (I think there was an update after upgrading to f40 that introduced this regression, but for sure the settings in f39 had the now-missing section.)

> "Turn off screen" in the "Display and Brightness" section is the setting
> that is supposed to turn off the screen on idle.

Perhaps, but it does not do that.  Don't forget that I did not change any settings -- I just applied an update and that introduced this problem. 
 
(Do you see that it says "Turn off screen: <drop-down> <drop-down>", where the second <drop-down> says "When locked: 1 minute"?  This does not mention idle at all.)
Comment 18 Nate Graham 2024-09-30 18:16:52 UTC
*** Bug 493765 has been marked as a duplicate of this bug. ***
Comment 19 Natalie Clarius 2024-09-30 21:47:38 UTC
It is the same setting that was previously in the section "Screen Energy Saving"; the page was reorganized a bit for Plasma 6.0. Apparently this wasn't clear enough, so perhaps we should tweak the wording a bit. Anyways, somehow the overhaul of the power management page seems to have broken this setting for you (though not for me).

It may be that something went wrong with the migration of the saved configuration to the new format with the update. Have you tried if resetting power management settings to defaults, or changing the screen turnoff setting to "Never", and then setting it back again makes it behave as normal?
Comment 20 Natalie Clarius 2024-09-30 21:49:38 UTC
(When you try this, make sure to click the Apply button after the changed settings in between.)
Comment 21 S. Umar 2024-09-30 22:56:59 UTC
I don't think this has to do with rearrangement of settings. I created a new user and experienced the same issue. I am suproised that some people are not experiencing it. There are patches in powerdevil upstream that deals with dbus and systemd. They may nor be related but this needs to be addressed. For the time being I set the power button to turn off screen and doing that.
Comment 22 Natalie Clarius 2024-09-30 23:03:48 UTC
There were some changes in the background service surrounding power settings too (not just the visual overhaul), but if the bug is present on a new user too, that can't be the cause. Thanks for the info.
Comment 23 Garry Williams 2024-09-30 23:06:19 UTC
(In reply to Natalie Clarius from comment #19)
> It is the same setting that was previously in the section "Screen Energy
> Saving"; the page was reorganized a bit for Plasma 6.0.

No.  It is not.  The old page said "(checkbox) Screen Energy Saving" and allowed "Switch off after" and a time.

> Apparently this
> wasn't clear enough, so perhaps we should tweak the wording a bit.

You are confused.

> Anyways,
> somehow the overhaul of the power management page seems to have broken this
> setting for you (though not for me).

I never changed anything.  The behavior changed after the update.

> Have you tried if resetting
> power management settings to defaults, or changing the screen turnoff
> setting to "Never", and then setting it back again makes it behave as normal?

You seem to not understand: I did nothing.  The update broke my system.
Comment 24 Natalie Clarius 2024-09-30 23:09:08 UTC
No, we're on the same page here. You didn't change anything, and the update broke the setting controlling screen turnoff after idle, which was previously named a bit differently but carries the same function.
Comment 25 Natalie Clarius 2024-09-30 23:13:14 UTC
"Turn off screen" in the "Display and Brightness" section *is* the old "Switch off after" in the old "Screen Energy Saving" section. Except that now this setting is broken for you.
Comment 26 Bug Janitor Service 2024-09-30 23:40:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/432
Comment 27 Natalie Clarius 2024-10-01 00:22:36 UTC
Just to make sure, you don't have anything saying that automatic sleep and screen locking is blocked when you click on the battery applet in the panel?
Comment 28 S. Umar 2024-10-01 00:30:14 UTC
On my laptop, clicking on battery applet shows "Sleep and screen locking after inactivity         automatic", manually block button is off.
Naturally, on the desktops there is no battery applet.
Comment 29 Steve Vialle 2024-10-01 07:07:58 UTC
Confirming. 
Power Management -> Display and Brightness -> Turn off screen: '1 minute, When Locked: 20 seconds'
No screen blank or DMPS powersave activates.
Worked as expected in 5.27.x

Operating System: Gentoo Linux 2.15
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.6.51-gentoo-dist (64-bit)
Graphics Platform: Wayland
Comment 30 Steve Vialle 2024-10-01 07:18:56 UTC
Oops, looks like this is a wayland-only problem for me. Screen power saving works perfectly in an X11 session.
Comment 31 Aaron.Ma 2024-10-01 13:28:51 UTC
Not a wayland only issue.

I use X11 with nvidia driver, the issue is reproduced.
Comment 32 Garry Williams 2024-10-01 14:00:48 UTC
(In reply to Steve Vialle from comment #30)
> Oops, looks like this is a wayland-only problem for me. Screen power saving
> works perfectly in an X11 session.

Look at the bug report.  I am using x11.
Comment 33 Steve Vialle 2024-10-01 14:14:25 UTC
Stay calm people, I said this is wayland-only **for me**. 
That is to say: My problem is apparently not the same as your problem, hence the "oops", because my initial comment didin't really belong here.
Comment 34 Natalie Clarius 2024-10-01 18:18:14 UTC
Garry ans Aaron, both of you have selected "Do nothing" for "Suspend Session". Can you try if it does suspend after the set time when you select "Sleep"? Then we'll know if it's specifically screen turn off on idle that doesn't work or if idle timeout isn't detected in general.
Comment 35 Natalie Clarius 2024-10-01 18:20:10 UTC
And Garry, you gave dimming activated after 5 minutes of idleness - does this work?
Comment 36 Garry Williams 2024-10-01 21:32:03 UTC
(In reply to Natalie Clarius from comment #34)
> Garry ans Aaron, both of you have selected "Do nothing" for "Suspend
> Session". Can you try if it does suspend after the set time when you select
> "Sleep"?

OK, I set Sleep after 1 minute and waited five minutes.  Nothing happened.  But...

I repeat: I do not want my laptop to sleep after inactivity.  I want the display to turn off after inactivity.  The system settings for Power Management no longer offer such an option.  This is a regression.  The settings used to offer that option in the section "Screen Energy Savings".  That section is gone now.

> Then we'll know if it's specifically screen turn off on idle that
> doesn't work or if idle timeout isn't detected in general.

I can't imagine how you can conclude such a thing, but I do not understand these changes either.  Of course that is quite irrelevant to my complaint anyway.
Comment 37 Garry Williams 2024-10-01 21:33:14 UTC
(In reply to Natalie Clarius from comment #35)
> And Garry, you gave dimming activated after 5 minutes of idleness - does
> this work?

No.
Comment 38 Natalie Clarius 2024-10-01 22:30:58 UTC
Thanks for testing, this narrows the problem down. So apparently the power management service fails to notice or trigger the actions when the specified time of inactivity has passed.

(In reply to Garry Williams from comment #36)
> I repeat: I do not want my laptop to sleep after inactivity.  I want the
> display to turn off after inactivity.  

Yes, I understood that.

In reply to Garry Williams from comment #36)
> The system settings for Power
> Management no longer offer such an option.  

No, that's the part you're misunderstanding. As I tried to explain above, this option *is* "Turn off screen" in the "Display and Brightness" section. It is the identical option as "Switch off after" in the "Screen Energy Saving" section in Plasma 5.27. It is just running under a different name and section now. It is not gone.
Comment 39 Natalie Clarius 2024-10-01 22:35:51 UTC
(In reply to Garry Williams from comment #36)
> I can't imagine how you can conclude such a thing, but I do not understand
> these changes either.  Of course that is quite irrelevant to my complaint
> anyway.

The relevance is the idling. We established that the screen-of-after-idle option exists (see my comments above) but does not work. If the sleep-after-idle and suspend-after-idle options don't work either, which you now confirmed, then it is quite likely that something goes wrong about the idle time detection. This helps track down where the problem is, which is why I was asking you to test these options.
Comment 40 Natalie Clarius 2024-10-01 22:54:16 UTC
This part from the attached log https://bugsfiles.kde.org/attachment.cgi?id=174162 of https://bugs.kde.org/show_bug.cgi?id=493765 seems relevant:
> Sep 28 11:58:39 pc-i7 org_kde_powerdevil[2920]: kf.idletime: Could not find any system poller plugin
> Sep 28 11:58:39 pc-i7 org_kde_powerdevil[2920]: qt.core.qobject.connect: QObject::connect(KAbstractIdleTimePoller, KIdleTime): invalid nullptr parameter
> Sep 28 11:58:39 pc-i7 org_kde_powerdevil[2920]: qt.core.qobject.connect: QObject::connect(KAbstractIdleTimePoller, KIdleTime): invalid nullptr parameter
Comment 41 Nicolas Fella 2024-10-01 23:24:25 UTC
> Sep 28 11:58:39 pc-i7 org_kde_powerdevil[2920]: kf.idletime: Could not find any system poller plugin

Fedora seems to be missing the X11 integration for KIdleTime, so idle detection doesn't work on X11.

This is because Fedora 40+ doesn't officially support Plasma X11, so https://src.fedoraproject.org/rpms/kf6-kidletime/c/063bdd3c53fb2aba41650185ea359398c4e2378d dropped the X11 support in KIdleTime
Comment 42 Garry Williams 2024-10-02 00:55:49 UTC
(In reply to Natalie Clarius from comment #38)
> No, that's the part you're misunderstanding. As I tried to explain above,
> this option *is* "Turn off screen" in the "Display and Brightness" section.
> It is the identical option as "Switch off after" in the "Screen Energy
> Saving" section in Plasma 5.27. It is just running under a different name
> and section now. It is not gone.

Then why does it NOT allow for switch off after idle.  It only allows "Turn off screen" "When locked: n minute" or "Custom".  No where does it state that screen should turn off on idle.  Where is the word "idle" in that section?

(And of course, the "Suspend Session" section has nothing to do with turning off screen.)
Comment 43 Natalie Clarius 2024-10-02 01:32:17 UTC
> Then why does it NOT allow for switch off after idle. 

Because the X11session is no longer supported on Fedora, so the setting is broken in this configuration; see Nicolas' comment.

>   No where does it state that screen should turn off on idle.  Where is the word "idle" in that section?

Yes, I took your feedback to heart and worked to changed it with the earlier linked https://invent.kde.org/plasma/powerdevil/-/merge_requests/432.

> (And of course, the "Suspend Session" section has nothing to do with turning off screen.)

No, but idle does, which is what I was trying to explain in my comment #39.
Comment 44 Natalie Clarius 2024-10-02 01:37:38 UTC
To reword Nicolas' conclusion: The reason this setting is broken for you is that you are using Plasma with the X11 session, which is not supported by Fedora. 

If you want screen turnoff on inactivity to work, you need to either:
1. Switch to the Wayland session
2. Switch to a different distribution
3. Complain to Fedora and ask them to revert the removal of idle support for X11.

This is nothing that we in KDE can do anything about I am afraid.
Comment 45 Garry Williams 2024-10-02 02:08:02 UTC
(In reply to Natalie Clarius from comment #44)
> If you want screen turnoff on inactivity to work, you need to either:
[snip]
> 3. Complain to Fedora and ask them to revert the removal of idle support for
> X11.
> 
> This is nothing that we in KDE can do anything about I am afraid.

Thank you for the clarification.

Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=2316045