Bug 440350

Summary: Screen never locks automatically due to something somewhere enforcing "never lock" as the default setting
Product: [Plasma] kscreenlocker Reporter: John Bennett <hornetster>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: REOPENED ---    
Severity: normal CC: bhush94, fabian, grahamperrin, hornetster, nate, yuking_net
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=433675
https://bugs.kde.org/show_bug.cgi?id=357288
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screen lock settings #1
Battery & Brightness
Battery & Brightness #1
attachment-18405-0.html
kscreenlockerrc file
/etc/xdg/kscreenlockerrc
Screenshot of Setting>Screenlocking
Settings>Screenlocking when working

Description John Bennett 2021-07-28 09:23:45 UTC
Created attachment 140366 [details]
Screen lock settings #1

SUMMARY
kscreenlocker Version 5.18.5

Have recently installed Opensuse Leap 15.3, and having problems trying to get the screen to lock/power off.
If I don't log on, screen seems to power off ok, but after logging on, never seems to lock/power off automatically, even when no 'extra' programs are running (ie even just the standard system components.)
Can Manually lock (Meta+L), but still doesn't go to power off.


STEPS TO REPRODUCE
1. Boot system and logon
2. Wait for screensaver to kick in
3. Never does

OBSERVED RESULT
Screensaver NEVER works.

EXPECTED RESULT
Screensaver works.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.76.0 ??
Qt Version: 5.12.7 ??

ADDITIONAL INFORMATION
Have tried various settings under:
 Settings>Workspace Behaviour>Screen Locking +
 Settings>Power Management
Comment 1 Nate Graham 2021-07-28 13:40:21 UTC
Is something inhibiting screen locking? You can see in the Battery & Brightness applet.
Comment 2 John Bennett 2021-07-29 09:08:57 UTC
Have checked that applet, but can't find specifically where it would tell me re: inhibiting screen locking.
Nothing obvious....
("Do not use special settings" selected.)
Comment 3 Nate Graham 2021-07-29 13:58:33 UTC
Can you attach a screenshot of what the Battery & Brightness applet looks like for you?
Comment 4 John Bennett 2021-07-30 04:09:17 UTC
Created attachment 140402 [details]
Battery & Brightness
Comment 5 John Bennett 2021-07-30 04:09:38 UTC
Have attached screenshot.
Comment 6 Nate Graham 2021-07-30 04:30:55 UTC
That's the System Settings page. Can you attach a screenshot of the System Tray applet?
Comment 7 John Bennett 2021-07-30 06:16:48 UTC
Created attachment 140404 [details]
Battery & Brightness #1

and if I select the Tools icon, get the previous shot...?
Comment 8 Nate Graham 2021-07-30 14:02:32 UTC
OK, so nothing is listed as inhibiting screen locking, then. Thanks.
Comment 9 Yuking 2021-07-31 14:01:09 UTC
I think it is the same bug as https://bugs.kde.org/show_bug.cgi?id=357288, and i am suffering from it. I am using an amd-3900X/X570 desktop computer.
Comment 10 John Bennett 2021-08-02 10:38:37 UTC
Have there been any updates recently?
Appears to be working 'mostly', at the moment, even the power...?
Will do some checking.
Comment 11 Nate Graham 2021-08-02 17:26:56 UTC
Possibly related to Bug 433675, or the same root cause?
Comment 12 John Bennett 2021-08-03 09:20:47 UTC
Seems to have gone back to 'not working' again...
Comment 13 John Bennett 2022-01-09 01:17:19 UTC
Have done a total reinstall of Tumbleweed (currently 20220106; KDE Plasma V5.23.4), with new user, and still intermittent at best.
Mostly not working.
Hardware is Dell Optiplex 9020, with 1TB SSD, 16GB RAM.
Thanks.
Comment 14 John Bennett 2022-01-09 01:25:08 UTC
New install of Tumbleweed (20220106 + KDE Plasma V5.23.4) on Dell Optiplex 9020 1TB ssd boot drive/16gb RAM Hardware.
Still VERY intermittent - mostly (95%) not working.
Have tried different settings in both Screensaver and Power.
Comment 15 John Bennett 2022-04-23 01:56:21 UTC
Seriously?
Is no-one else seeing this?
Screensaver/power control not working at all, after login. If I leave on the login screen, works OK.
Have installed MANY other distros, and never had an issue.
Comment 16 John Bennett 2022-09-14 06:46:43 UTC
And this is STILL happening....
Comment 17 Nate Graham 2022-09-15 16:05:39 UTC
Apparently no one else is seeing it.

Can you manually lock the screen with Meta+L?
Comment 18 John Bennett 2022-09-15 23:32:53 UTC
(In reply to Nate Graham from comment #17)
> Apparently no one else is seeing it.
> 
> Can you manually lock the screen with Meta+L?

Yep, works fine.
Comment 19 Nate Graham 2022-09-16 18:54:26 UTC
Do you have an NVIDIA GPU, by any chance?
Comment 20 John Bennett 2022-09-16 21:10:20 UTC
Created attachment 152133 [details]
attachment-18405-0.html

No, standard Intel graphics.

On Sat, 17 Sept 2022, 04:54 Nate Graham, <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=440350
>
> --- Comment #19 from Nate Graham <nate@kde.org> ---
> Do you have an NVIDIA GPU, by any chance?
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are on the CC list for the bug.
Comment 21 Nate Graham 2022-09-19 19:00:32 UTC
Ok, thanks.

Still stumped. :/
Comment 22 John Bennett 2022-09-20 09:39:44 UTC
OK, will 'fess up here and say I am not completely convinced myself about the cause of this... and not sure how/if this could affect it at all, but:
Over the last couple of days, after having completely disconnected my Thunderbird profile (removed config, and created new profile, copying old local mail folders to new profile, have changed from POP to IMAP), for a day or so, both screenlock + power save seemed to work, but after since not having changed anything, is now not working again...
Thought I would mention this.

Thunderbird 102.2.2 (64bit)
Tumbleweed 20220916
Comment 23 Nate Graham 2022-11-04 21:42:28 UTC
Can we please ask you to see if you can reproduce the issue with a recent software version? Like Plasma 5.25, or ideally 5.26?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 24 John Bennett 2022-11-05 03:18:59 UTC
Now running Tumbleweed 20221029/KDE Plasma 5.26.2/Qt 5.15.6/Kernel 6.0.5-1-default/X11.
Still having the issue.
Comment 25 Nate Graham 2022-11-07 18:30:26 UTC
Can you attach your ~/.config/kscreenlockerrc file?
Comment 26 John Bennett 2022-11-08 09:21:23 UTC
Created attachment 153580 [details]
kscreenlockerrc file
Comment 27 Nate Graham 2022-11-08 15:59:53 UTC
Interesting, that's not what I would have expected. Do you have a `/etc/xdg/kscreenlockerrc` file? If so can you attach that too?

Also can you attach a screenshot of your Screen Locking page in System Settings?
Comment 28 John Bennett 2022-11-08 23:42:37 UTC
Created attachment 153606 [details]
/etc/xdg/kscreenlockerrc
Comment 29 John Bennett 2022-11-08 23:46:09 UTC
Created attachment 153607 [details]
Screenshot of Setting>Screenlocking
Comment 30 Nate Graham 2022-11-09 19:32:53 UTC
Thanks. does it start working if you add

[Daemon]
Timeout=1

to ~/.config/kscreenlockerrc, restart, and then wait a minute or so?
Comment 31 John Bennett 2022-11-10 05:32:11 UTC
Fixed!!?
How easy was that.
If only I had known what a 'standard' config file looked like...
But, asks the question, why did it break in the first place. Beleive it happened when I did a "fresh" install of Tumbleweed..?
Anyway, am wrapped now that it's working.
Thanks a heap, Nate.
Will mark as resolved.
Comment 32 Nate Graham 2022-11-10 15:04:41 UTC
Heh, fixed for you, but clearly there is a bug somewhere that we need to find.

With that line in your config file, can you attach another screenshot of what your Screen Locking settings page looks like?
Comment 33 John Bennett 2022-11-11 00:15:03 UTC
Created attachment 153658 [details]
Settings>Screenlocking when working

Pretty much the same...
Comment 34 Nate Graham 2022-11-14 18:54:18 UTC
Thanks. And to confirm, if you click the "Defaults" button at the bottom of the page, such that your kscreenlockerrc file loses its "Timeout=1" line, does the problem come back?

If so, this suggests that the default setting on your system is "never lock the screen" for some reason.
Comment 35 John Bennett 2022-11-14 19:44:19 UTC
Sorry, away for the next 2 weeks. Will check when back home
Comment 36 John Bennett 2022-11-27 05:35:20 UTC
Back after being away. Don't recall playing with anything before going away, but on return, screen locking again not working. 
On checking the ~/.config/kscreenlockerrc file, contains:
************
[$Version]
update_info=kscreenlocker.upd:0.1-autolock

[Daemon]
LockGrace=10
*************

So, correcting things again, all is working, and, yes, clicking 'Defaults' does again break it...
Comment 37 Nate Graham 2022-11-28 23:28:17 UTC
This suggests that the code has been patched to make "never lock" the default setting. Fabian, are you aware of any such patch on openSUSE?
Comment 38 Fabian Vogt 2022-11-29 08:29:54 UTC
(In reply to Nate Graham from comment #37)
> This suggests that the code has been patched to make "never lock" the
> default setting. Fabian, are you aware of any such patch on openSUSE?

No. In fact, openQA sees the lockscreen regularly and reliably (which is actually a bit annoying to deal with there...).
Comment 39 Nate Graham 2022-11-29 16:22:40 UTC
Then I am quite confused.

If this behavior happens with no override in ~/.config/kscreenlockerrc, that means that *somewhere* the default has gotten set to "never lock".

We checked /etc/xdg/kscreenlockerrc and it's not there. Fabian says openSUSE isn't changing this default in the code. Where else could it be coming from?
Comment 40 John Bennett 2022-11-29 23:24:47 UTC
Beginning to wonder what is going on here...
On occasions (don't believe ALL the time), turn the computer on, no screenlock, log out/in, screenlock works. Files have not been changed, all looks good...
Beginning to think I will do a full/clean reinstall...
Comment 41 John Bennett 2022-12-11 07:47:11 UTC
Complete fresh install of Tumbleweed (openSUSE-Tumbleweed-DVD-x86_64-Snapshot20221209-Media.iso), no screenlock enabled.

Add the:
[Daemon]
Timeout=1

to the file, logout/in, working so far.
Comment 42 John Bennett 2022-12-11 23:15:27 UTC
(In reply to John Bennett from comment #41)
> Complete fresh install of Tumbleweed
> (openSUSE-Tumbleweed-DVD-x86_64-Snapshot20221209-Media.iso), no screenlock
> enabled.
> 
> Add the:
> [Daemon]
> Timeout=1
> 
> to the file, logout/in, working so far.

Also (noticed this previously, as well), often (nearly always), after starting the computer, screenlock doesn't work, but after logging out/in, it does..?
Comment 43 John Bennett 2023-05-16 01:19:01 UTC
Yep, and another fresh install later....
Works fine in Wayland.
Doesn't work on initial install to X11, but works (generally) on a logout/login after...
Comment 44 John Bennett 2023-05-16 01:21:21 UTC
(In reply to John Bennett from comment #43)
> Yep, and another fresh install later....
> Works fine in Wayland.
> Doesn't work on initial install to X11, but works (generally) on a
> logout/login after...

That should be "Doesn't work on initial boot to X11, ....."
Thanks.