Bug 523988 - Display remains stuck on dimmed gamma/DPMS state after sleep until kwin_wayland is restarted
Summary: Display remains stuck on dimmed gamma/DPMS state after sleep until kwin_wayl...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.7.3
Platform: EndeavourOS Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-07 18:45 UTC by Wael Lejmi
Modified: 2026-10-30 18:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.7.6
Sentry Crash Report:


Attachments
Power Management Settings Screenshot (123.85 KB, image/png)
2026-08-07 18:45 UTC, Wael Lejmi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wael Lejmi 2026-08-07 18:45:37 UTC
Created attachment 194957 [details]
Power Management Settings Screenshot

DESCRIPTION
The screen remains stuck on an extremely dim state after waking up, but ONLY when the system enters sleep/display power down via PowerDevil's automatic idle timer. 

If the system is put to sleep manually (via GUI, lock screen, or running `systemctl suspend`), waking up works perfectly with normal screen brightness. Modifying brightness controls after the bug occurs does nothing until restarting the compositor via `kwin_wayland --replace > /dev/null 2>&1 &`.

STEPS TO REPRODUCE
1. In System Settings -> Power Management,  under Suspend Session,  When inactive, Sleep , After 45 minutes(Never tried with shorter time but it always happens with 45mins). More settings that could be useful Under Display and Brightness, Dim automatically  is set to 10 min, Turn off screen is set to 15min and when locked is set to 15sec
2. Do not interact with the PC and allow the idle timer to put the screen/system to sleep automatically.
3. Wake the system using keyboard or mouse input.

OBSERVED RESULT
The screen wakes up but remains stuck in PowerDevil's dimmed state. Brightness controls have no effect. Running `kwin_wayland --replace` immediately restores full display brightness and control.

EXPECTED RESULT
Display brightness should return to normal active levels regardless of whether sleep was triggered manually or by the idle timer.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.7.3
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
Kernel Version: 7.1.5-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X3D 8-Core Processor
Memory: 32 GiB of RAM (31.2 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3080 

ADDITIONAL INFORMATION
Running "systemctl --user status plasma-powerdevil.service"  outputs this:
Aug 07 18:53:19 wael-amigo org_kde_powerdevil[1041]: [  1041] Unquiescing libddcutil API...
Aug 07 18:53:19 wael-amigo org_kde_powerdevil[1041]: [ 10836][15123.136578] Recheck interval: Sleeping for 200 milliseconds
Aug 07 18:53:19 wael-amigo org_kde_powerdevil[1041]: [  1041][15123.136591] (ddca_get_display_refs) Returned DDCA_Display_Ref lis>
Aug 07 18:53:19 wael-amigo org_kde_powerdevil[1041]: [  1041][15123.136606]    DDCA_Display_Ref Display_Ref[8:bus /dev/i2c-4 @0x7>
Aug 07 18:53:20 wael-amigo org_kde_powerdevil[1041]: There are no outputs - creating placeholder screen
Aug 07 18:53:20 wael-amigo org_kde_powerdevil[1041]: The Wayland connection broke. Did the Wayland compositor die?
Aug 07 18:53:20 wael-amigo org_kde_powerdevil[1041]: Attempting wayland reconnect
Aug 07 18:53:20 wael-amigo org_kde_powerdevil[1041]: Failed to write to the pipe: Bad file descriptor.
Aug 07 18:53:51 wael-amigo org_kde_powerdevil[1041]: org.kde.powerdevil.chargethresholdhelper.getconservationmode failed "Battery>
Aug 07 18:53:51 wael-amigo org_kde_powerdevil[1041]: org.kde.powerdevil.chargethresholdhelper.getconservationmode failed "Battery>
Comment 1 Nate Graham 2026-08-12 21:32:13 UTC
> The Wayland connection broke. Did the Wayland compositor die?

This typically means KWin crashed. Is there a kwin_wayland backtrace in the output of `coredumpctl --reverse`?

Also: how many screens do you have, how are they connected, and what are they?
Comment 2 Wael Lejmi 2026-08-13 05:38:06 UTC
(In reply to Nate Graham from comment #1)
> This typically means KWin crashed. Is there a kwin_wayland backtrace in the
No kwin doesn't crash but maybe this showed up after my workaround which is basically killing kwin_wayland and replacing it (restarting it) . I run this to fix the bug:  "kwin_wayland --replace > /dev/null 2>&1 & "

> output of `coredumpctl --reverse`?
I just recreated the bug and it doesn't show anything related ( I only have 2 entries from FreeFileSync)

> Also: how many screens do you have, how are they connected, and what are they?
I have 2 monitors,  Asus VG27AQ3A plugged with DP port and HP L1908w plugged with a HDMI to VGA.

I even tried "ddcutil setvcp 10 100 --display 1 --sleep-multiplier .5" instead of restarting kwin_wayland but it didnt work. Both monitors stay in dimmed state, restarting the powerDevil service doesnt do  anything too. The only consistent workaround I found is restarting kwin_wayland.
Comment 3 Nate Graham 2026-08-13 21:05:43 UTC
Yeah, manually killing and restarting kwin_wayland will reset the Wayland socket.

You're saying restarting kwin_wayland *fixes* the issue? It doesn't *cause* the issue?

So basically, that Wayland socket disconnection that you were talking about… you're saying it's something that happens independently of you manually restarting kwin_wayland, and restarting kwin_wayland fixes the issue? Do I have that right?
Comment 4 Wael Lejmi 2026-08-13 21:14:25 UTC
Yes, That is exactly what I am saying: restarting kwin_wayland  *fixes* the issue (workaround), but I am sure its not the root cause. I am sure the culprit is the Power Management (plasma-powerdevil.service, if I am correct). Because I have successfully recreated the bug using different times (look at the screenshot included in the bug report attachments )

Basically the bug boils down to this: if I manually put my pc to sleep, it wakes up fine. If the power management does it (after the timer), it wakes up dimmed and stays dimmed. Restarting the powerdevil service or using ddcutil does nothing, the only consistent workaround is restarting kwin_wayland (which crashes firefox  and closes my tabs but not a problem) .
Comment 5 Wael Lejmi 2026-08-13 21:17:59 UTC
After reading title of my bug report, I apologize for the confusion I caused. Since I didn't find any traces or logs that can help me. I completely forgot that I keep restarting kwin_wayland which causes the wayland socket disconnect log.
Comment 6 Bug Janitor Service 2026-08-28 03:47:20 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 7 Wael Lejmi 2026-08-28 19:06:20 UTC
I can easily reproduce the bug on my machine. How / where would you recommend me looking for logs that might help ?
Comment 8 Throstur 2026-09-06 21:41:26 UTC
I can reproduce what appears to be the same issue on Arch Linux with Plasma 6.7.4, Wayland, and NVIDIA proprietary drivers.

After resuming from suspend/standby, both active desktop monitors were left extremely dim to the point of being effectively unusable.

I was able to restore the displays immediately without restarting KWin or Plasma by forcing the per-output dimming value back to 100:

```
kscreen-doctor output.<output>.dimming.100
```

Applying that to the affected outputs restored normal brightness immediately.

This makes it look like the per-output KWin/PowerDevil dimming state is remaining below 100 after resume rather than being restored correctly.

Environment:

Arch Linux
KDE Plasma 6.7.4
Wayland
NVIDIA RTX 3050
Multiple external desktop monitors

I have disabled automatic dimming for now as a workaround.
Comment 9 Bug Janitor Service 2026-09-21 03:48:42 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 10 Wael Lejmi 2026-09-22 18:47:12 UTC
(In reply to Throstur from comment #8)
I can confirm it works and restores functionality (sliding brightness levels) , without needing to restart kwin_wayland and losing apps (e.g firefox). 
This works great, thanks for the tip.
Comment 11 Bug Janitor Service 2026-10-07 03:49: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 12 Bug Janitor Service 2026-10-22 03:47:22 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 13 Jakob Petsovits 2026-10-27 19:11:52 UTC
A relevant merge request has been opened @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/720
Comment 14 Jakob Petsovits 2026-10-27 21:32:08 UTC
Git commit 78a96e9ddb3a4cf2eb064c2b032864db7c9963a7 by Jakob Petsovits, on behalf of Petru Mare.
Committed on 27/10/2026 at 19:10.
Pushed by jpetso into branch 'master'.

Fix screens staying dimmed after losing brightness control

When a DDC/CI write fails (for example after the monitor powered down and
libddcutil invalidated its handle), DDCutilDisplay gives up on the display
and KWin unsets its brightness device. KWinDisplayDetector then drops the
output, but KWin keeps applying the last dimming factor in software, so a
screen that was idle-dimmed to 30% stays at 30% until KWin restarts.
Re-detecting the output didn't help either: the new KWinDisplayBrightness
assumed a dimming of 1.0, so setting 1.0 was a no-op.

Reset the dimming of outputs we stop managing, start from the dimming KWin
reports, and apply the current dimming ratio to newly detected displays.

M  +14   -3    daemon/controllers/kwinbrightness.cpp
M  +2    -0    daemon/controllers/screenbrightnesscontroller.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/78a96e9ddb3a4cf2eb064c2b032864db7c9963a7
Comment 15 Jakob Petsovits 2026-10-27 21:34:26 UTC
Git commit e49c98f353145f30facb58a2c90adc6ab124270f by Jakob Petsovits.
Committed on 27/10/2026 at 21:32.
Pushed by jpetso into branch 'Plasma/6.8'.

Fix screens staying dimmed after losing brightness control

When a DDC/CI write fails (for example after the monitor powered down and
libddcutil invalidated its handle), DDCutilDisplay gives up on the display
and KWin unsets its brightness device. KWinDisplayDetector then drops the
output, but KWin keeps applying the last dimming factor in software, so a
screen that was idle-dimmed to 30% stays at 30% until KWin restarts.
Re-detecting the output didn't help either: the new KWinDisplayBrightness
assumed a dimming of 1.0, so setting 1.0 was a no-op.

Reset the dimming of outputs we stop managing, start from the dimming KWin
reports, and apply the current dimming ratio to newly detected displays.


(cherry picked from commit 0ca9bdb82c927518ca60eef589bd89ec6192ef6d)

Co-authored-by: Petru Mare <marepetru2015@gmail.com>

M  +14   -3    daemon/controllers/kwinbrightness.cpp
M  +2    -0    daemon/controllers/screenbrightnesscontroller.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/e49c98f353145f30facb58a2c90adc6ab124270f
Comment 16 Jakob Petsovits 2026-10-27 21:35:59 UTC
Git commit 76dc5ace88031d03a86acd93767730e389e2b8ab by Jakob Petsovits.
Committed on 27/10/2026 at 21:34.
Pushed by jpetso into branch 'Plasma/6.7'.

Fix screens staying dimmed after losing brightness control

When a DDC/CI write fails (for example after the monitor powered down and
libddcutil invalidated its handle), DDCutilDisplay gives up on the display
and KWin unsets its brightness device. KWinDisplayDetector then drops the
output, but KWin keeps applying the last dimming factor in software, so a
screen that was idle-dimmed to 30% stays at 30% until KWin restarts.
Re-detecting the output didn't help either: the new KWinDisplayBrightness
assumed a dimming of 1.0, so setting 1.0 was a no-op.

Reset the dimming of outputs we stop managing, start from the dimming KWin
reports, and apply the current dimming ratio to newly detected displays.


(cherry picked from commit 0ca9bdb82c927518ca60eef589bd89ec6192ef6d)

Co-authored-by: Petru Mare <marepetru2015@gmail.com>

M  +14   -3    daemon/controllers/kwinbrightness.cpp
M  +2    -0    daemon/controllers/screenbrightnesscontroller.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/76dc5ace88031d03a86acd93767730e389e2b8ab