Bug 508859

Summary: P14s-amd does not show login screen after sleep by closing the laptop-lid
Product: [Plasma] kwin Reporter: slartibart70
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: kde, kdedev, nate, xaver.hugl
Priority: NOR    
Version First Reported In: 6.4.80   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: journal
journal -xb

Description slartibart70 2025-08-28 14:52:51 UTC
My Lenovo p14s-gen4 amd when used standalone (no external monitor, no thunderbolt connections) does not wake up after sleep when closing the lid.

I currently have 2 "interesting" features:
- Powermanagement / on battery: when laptop lid closed: 'sleep'
This does put the p14s to sleep, but opening the lid does not display anything on the screen, it remains black.
The keyboard status indicators (fn-lock on esc key, mic-mute and speaker-mute LEDs are active, but no keyboard input reaches the sleeping system. 
A reboot (by killing the system with 7sec press on the power switch) is necessary

Powermanagement / on battery: when laptop lid closed: 'sleep'
Yet, put the laptop to sleep manually (ctrl-alt-del, click sleep)
The lenovo (on the lid itself) red status-led is blinking (indicating sleep) 
Close the lid.
When the lid is fully closed, the system wakes up again (the led is now constantly on, the screen - when opening the lid again, is active)

Powermanagement / on battery: when laptop lid closed: 'do nothing'
put the laptop to sleep manually (ctrl-alt-del, click sleep)
The lenovo (on the lid itself) red status-led is blinking (indicating sleep) 
Close the lid.
Open the lid. The keyboard status indicators (fn-lock on esc key, mic-mute and speaker-mute LEDs are active, but no keyboard input reaches the sleeping system. 
A reboot (by killing the system with 7sec press on the power switch) is necessary

This was all fine - even with plasma6.5 - some time ago.
I never had problems with 6.4

What do you need for further investigation?

---
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.1
Kernel Version: 6.16.3-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 ร— AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 64 GiB of RAM (58.5 GiB usable)
Graphics Processor: AMD Radeon 780M Graphics
Comment 1 TraceyC 2025-08-28 19:49:15 UTC
It's possible that either kwin or the kernel is not doing the right thing in response to lid events and sleep events.  Can you run:

> journalctl -xb 0 > ~/Desktop/boot.log

And then go through it and remove any personal information, and then attach it here? That will help us narrow down what's happening. Thanks.
Comment 2 slartibart70 2025-08-29 06:55:05 UTC
Created attachment 184547 [details]
journal

sample journal
Comment 3 slartibart70 2025-08-29 06:56:48 UTC
Created attachment 184548 [details]
journal -xb
Comment 4 TraceyC 2025-08-29 17:39:10 UTC
Thanks for the logs, those are helpful. They do show there are two things happening, as you said. They are unrelated from what I see.

1. systemd-logind is getting the lid open and close events. I see where the lid opened and the system suspends. I see later, the lid closed and there was a wake event. These are all being handled by systemd-logind / the kernel, and as such, are outside of anything KDE controls. I recommend contacting the Fedora folks about that, or Lenovo support (if the laptop came with Fedora installed).

This, at the end of the log, might be pertinent:
```
Aug 27 23:49:36 p14s kernel: ACPI: button: The lid device is not compliant to SW_LID.
```

2. When the lid opens and the display remains blank - I do see some logs that indicate a possible problem with kwin, that we can look into.

During the wake event, this is where KDE is affected, and what is actionable for us:

```
Aug 27 23:48:49 p14s audit[12406]: USER_AUTH pid=12406 uid=10001 auid=10001 ses=3 subj=unconfined_u:unconfined_r:chkpwd_t:s0-s0:c0.c1023 msg='op=PAM:unix_chkpwd acct="claus" exe="/usr/bin/unix_chkpwd" hostname=? addr=? terminal=? res=success'
Aug 27 23:48:49 p14s kscreenlocker_greet[12282]: qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)
Aug 27 23:48:49 p14s kscreenlocker_greet[12282]: Failed to write to the pipe: Bad file descriptor.
```

All the log lines involving kwin and kscreenlocker

```
โฏ rg -N "kwin_|kscreen" lenovo_logs.txt
Aug 27 23:21:22 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to KWin::XdgToplevelWindow(0x564d9bc965c0, surface=KWin::SurfaceInterface(0x564d9be1e610), caption="Krusader")
Aug 27 23:24:36 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to Window(0x0)
Aug 27 23:26:22 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to Window(0x0)
Aug 27 23:28:59 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to Window(0x0)
Aug 27 23:38:25 p14s kwin_wayland_wrapper[4797]: Key repeat discarded, Wayland compositor doesn't seem to be processing events fast enough!
Aug 27 23:38:25 p14s kwin_wayland_wrapper[4797]: Key repeat discarded, Wayland compositor doesn't seem to be processing events fast enough!
Aug 27 23:38:28 p14s kwin_wayland_wrapper[4797]: Key repeat discarded, Wayland compositor doesn't seem to be processing events fast enough!
Aug 27 23:38:58 p14s kwin_wayland[4685]: qt.dbus.integration: QDBusConnection: couldn't handle call to Teardown, no slot matched
Aug 27 23:38:58 p14s kwin_wayland[4685]: qt.dbus.integration: QDBusConnection: couldn't handle call to Teardown, no slot matched
Aug 27 23:38:58 p14s kwin_wayland[4685]: qt.dbus.integration: Could not find slot Krunner1Adaptor::Teardown
Aug 27 23:39:02 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to Window(0x0)
Aug 27 23:39:02 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to Window(0x0)
Aug 27 23:47:22 p14s kwin_wayland[4685]: kwin_core: Failed to delay sleep: Sender is not authorized to send message
Aug 27 23:47:39 p14s kwin_wayland[4685]: kwin_core: Failed to delay sleep: Sender is not authorized to send message
Aug 27 23:47:58 p14s kscreenlocker_greet[11940]: qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)
Aug 27 23:47:58 p14s kscreenlocker_greet[11940]: pam_unix(kde:auth): authentication failure; logname=claus uid=10001 euid=10001 tty= ruser= rhost=  user=claus
Aug 27 23:47:58 p14s kscreenlocker_greet[11940]: QEventLoop: Cannot be used without QCoreApplication
Aug 27 23:48:00 p14s kscreenlocker_greet[11940]: Failed to write to the pipe: Bad file descriptor.
Aug 27 23:48:09 p14s kwin_wayland[4685]: kwin_core: Failed to delay sleep: Sender is not authorized to send message
Aug 27 23:48:26 p14s kwin_wayland[4685]: kwin_libinput: Libinput: event1  - Lid Switch: client bug: event processing lagging behind by 1980ms, your system is too slow
Aug 27 23:48:26 p14s kwin_wayland[4685]: kwin_libinput: Libinput: event0  - Power Button: client bug: event processing lagging behind by 693ms, your system is too slow
Aug 27 23:48:49 p14s kscreenlocker_greet[12282]: qt.qpa.wayland: Could not create EGL surface (EGL error 0x3000)
Aug 27 23:48:49 p14s kscreenlocker_greet[12282]: Failed to write to the pipe: Bad file descriptor.
Aug 27 23:48:54 p14s kwin_wayland[4685]: kwin_core: Cannot grant a token to KWin::XdgToplevelWindow(0x564d9a6fa0b0, surface=KWin::SurfaceInterface(0x564d9c12c4b0), caption="Quick Settings โ€” System Settings")
```
Comment 5 TraceyC 2025-09-02 21:01:37 UTC
I'm not able to reproduce this on git-master

Moving to kwin since it looks related to the display
Comment 6 Nate Graham 2025-09-16 21:27:25 UTC
This could also be a kerne issue.
Comment 7 David Edmundson 2025-10-08 12:28:02 UTC
Is this still happening
We need to break down if this is kwin or the lockscreen. 

Can you temporarily run:
 - system settings -> screen locking  and unset "lock after waking from sleep"

and see if the issue still appears
Comment 8 slartibart70 2025-10-09 21:18:39 UTC
The situation seems to have improved a lot:

independent of the setting of the 'lock' option you mentioned, the system wakes up properly after sleep.
This is valid for both manually setting the system to sleep (Meta-L, then sleep) or by closing/opening the laptop lid

Operating System: Fedora Linux 42
KDE Plasma Version: 6.5.80
KDE Frameworks Version: 6.20.0
Qt Version: 6.9.2
Kernel Version: 6.16.11-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 9 slartibart70 2025-10-09 21:25:09 UTC
But, one problem remains:

Setting the option 
Powermanagement / on battery: when laptop lid closed: 'do nothing'

and then closing the lid, the screen turns dark (i can peek a little bit under the panel without activating the 'lid open' status)

Opening the lid lights up the keyboard status indicators (fn-lock on esc key, mic-mute and speaker-mute LED) but the screen remains dark!
Luckily, i'm at home and can reconnect my thunderbolt-box with an external 4K monitor (i'm typing this on the other screen with the laptop panel still being black)
This is with:   [x] lock after waking from sleep:

So, yes, some improvements,
but still more investigation necessary
Comment 10 slartibart70 2025-10-09 21:31:57 UTC
and without the lock setting:
 [ ] lock after waking from sleep

there is a change in behavior:
- opening the lid has still a black laptop screen, keyboard LEDs are lit
- plug in TB4 box
Now, the external screen and(!) the laptop panel come back to live

Hope this helps in finding the problem...
Comment 11 Zamundaaa 2025-10-17 10:26:31 UTC
Okay, sounds like some sort of drm related issue. Please follow https://invent.kde.org/plasma/kwin/-/wikis/Debugging/Debugging-DRM-issues to get a drm debug log of the display not turning on again - both KWin and dmesg logs could be helpful in figuring out what's happening.
Comment 12 Bug Janitor Service 2025-11-01 03:48:00 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 13 Bug Janitor Service 2025-11-16 03:48:23 UTC
๐Ÿ›๐Ÿงน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.