git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit350eb1bba71a7173c83650fbc5a8bfcc71e347fe
parent1db41de78c
authorIsaac Freund <[email protected]>
date2026-03-02 11:01
OutputManager: don't forget .soft_disabled state

Currently, if an output is soft disabled using the
wlr-output-power-management-v1 protocol, this state is overwritten
y the next wlr-output-management-v1 commit.

 river/OutputManager.zig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/river/OutputManager.zig b/river/OutputManager.zig
index 9db205a..0618a31 100644
--- a/river/OutputManager.zig
+++ b/river/OutputManager.zig
@@ -136,7 +136,14 @@ fn handleManagerApply(_: *wl.Listener(*wlr.OutputConfigurationV1), config: *wlr.
     while (it.next()) |head| {
         const output: *Output = @ptrCast(@alignCast(head.state.output.data));
         if (head.state.enabled) {
+            const previous = output.scheduled.state;
             output.scheduled = .fromHeadState(&head.state);
+            // Maintain power management state set with wlr-output-power-management-v1
+            if (previous == .disabled_soft) {
+                output.scheduled.state = .disabled_soft;
+            } else {
+                assert(output.scheduled.state == .enabled);
+            }
         } else {
             // Avoid overwriting and losing all other output state on disable.
             output.scheduled.state = .disabled_hard;