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

commit29f513dc9217abb329b8112e29af74c9c5482396
parent7bc0b46ebd
authorIsaac Freund <[email protected]>
date2025-12-08 13:58
OutputManager: fix initial modeset on DRM backend

This has the unfortunate side effect of making the initial size of
the Wayland backend's window wrong, I don't see a clean fix for that
yet though.

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

diff --git a/river/OutputManager.zig b/river/OutputManager.zig
index 7b09086..8219fcd 100644
--- a/river/OutputManager.zig
+++ b/river/OutputManager.zig
@@ -299,7 +299,12 @@ pub fn commitOutputState(om: *OutputManager) void {
                     if (mode.height != wlr_output.height) break :blk true;
                     if (mode.refresh != wlr_output.refresh) break :blk true;
                 },
-                .none => {},
+                .none => unreachable,
+            }
+            // If an output newly exposed to river is already enabled, we
+            // must modeset since the mode is otherwise undefined.
+            if (output.current.mode == .none and output.sent.state == .enabled) {
+                break :blk true;
             }
             if (output.sent.adaptive_sync != (wlr_output.adaptive_sync_status == .enabled)) {
                 break :blk true;