Bug 499029

Summary: Suspend on lid close stop working after libkscreen commit 7afede8
Product: [Plasma] KScreen Reporter: fanzhuyifan
Component: commonAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: expected kscreen-doctor output
powerdevil log before 7afede8
powerdevil log after 7afede8

Description fanzhuyifan 2025-01-22 22:44:56 UTC
Created attachment 177602 [details]
expected kscreen-doctor output

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY


STEPS TO REPRODUCE
1. Run org_kde_powerdevil with environment variable "POWERDEVIL_NO_DDCUTIL=1"
2. Set lid close action to suspend, even when external display is connected
3. close lid, when external display is connected

OBSERVED RESULT
System does not suspend. Can still interact with system on external display.

EXPECTED RESULT
System suspends.


ALTERNATE STEPS TO REPRODUCE:
1. Run kscreen-doctor -o

ALTERNATE OBSERVED RESULT
kscreen.kwayland: Connection to Wayland server timed out.
kscreen.doctor: Invalid config.
<command hangs and never finishes>

ALTERNATE EXPECTED RESULT
Correct display output is printed and system exits (just like before 7afede8)

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.11.0
Qt Version: 6.9.0
Kernel Version: 6.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i9-13900H
Memory: 15.2 GiB of RAM
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: llvmpipe
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G16 GU603VV_GU603VV
System Version: 1.0

ADDITIONAL INFORMATION


Bisect log for libkscreen:

git bisect start
# status: waiting for both good and bad commits
# bad: [7d346aea0e1e9d0dfc77c7deb2fc5e47784178e7] backends/kwayland: Don't leak output configuration if it contains no real changes
git bisect bad 7d346aea0e1e9d0dfc77c7deb2fc5e47784178e7
# status: waiting for good commit(s), bad commit known
# good: [c7e322d034734583f6a8e488de4f9cba45311ad0] Dep on latest Plasma Wayland Protocols
git bisect good c7e322d034734583f6a8e488de4f9cba45311ad0
# good: [d3efb5c3a4684da3c2eebbb08c36ad66ebeb7024] doctor: add dpms to help text
git bisect good d3efb5c3a4684da3c2eebbb08c36ad66ebeb7024
# bad: [7afede862ca2809c007214a8d5cba9649ca21a45] backends/kwayland: Remove unbalanced unblockSignals()
git bisect bad 7afede862ca2809c007214a8d5cba9649ca21a45
# good: [47bbd2e2e54c842e1b736d7124ca51ccc175944c] backends/kwayland: Reject configs with unknown outputs
git bisect good 47bbd2e2e54c842e1b736d7124ca51ccc175944c
# first bad commit: [7afede862ca2809c007214a8d5cba9649ca21a45] backends/kwayland: Remove unbalanced unblockSignals()
Comment 1 fanzhuyifan 2025-01-22 22:45:36 UTC
Created attachment 177603 [details]
powerdevil log before 7afede8
Comment 2 fanzhuyifan 2025-01-22 22:45:55 UTC
Created attachment 177604 [details]
powerdevil log after 7afede8
Comment 3 Bug Janitor Service 2025-01-22 23:27:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libkscreen/-/merge_requests/230
Comment 4 fanzhuyifan 2025-01-22 23:29:40 UTC
Git commit 063fb1c5feed0e4fa14654ab1033465adf6a07e1 by Yifan Zhu.
Committed on 22/01/2025 at 23:25.
Pushed by vladz into branch 'Plasma/6.3'.

Revert "backends/kwayland: Remove unbalanced unblockSignals()"

This reverts commit 7afede862ca2809c007214a8d5cba9649ca21a45.

M  +1    -0    backends/kwayland/waylandconfig.cpp

https://invent.kde.org/plasma/libkscreen/-/commit/063fb1c5feed0e4fa14654ab1033465adf6a07e1
Comment 5 Bug Janitor Service 2025-01-22 23:32:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libkscreen/-/merge_requests/231
Comment 6 fanzhuyifan 2025-01-23 09:39:21 UTC
Git commit 46b13032056017de2bf38abff6f5d35e1354bdea by Yifan Zhu.
Committed on 22/01/2025 at 23:28.
Pushed by vladz into branch 'master'.

backends/kwayland: initialize m_blockSignals to false

Initialization should already be protected by done events and
m_initializingOutputs. The removal of unblockSignals in 7afede8 meant
that we need to initialize m_blockSignals to false.

M  +1    -1    backends/kwayland/waylandconfig.cpp

https://invent.kde.org/plasma/libkscreen/-/commit/46b13032056017de2bf38abff6f5d35e1354bdea