Skip to content

fix(wayland): retain output modes until finished - #3788

Merged
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
eaceaser:fix/wayland-output-mode-lifetime
Aug 4, 2026
Merged

fix(wayland): retain output modes until finished#3788
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
eaceaser:fix/wayland-output-mode-lifetime

Conversation

@eaceaser

@eaceaser eaceaser commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Retain zwlr_output_mode_v1 proxies until their Wayland lifecycle ends instead of releasing them immediately when announced.

Motivation

Commit 489de6f76 introduced immediate mode-proxy release while adding monitor serial-number support.

A compositor may reference an announced mode in subsequent events such as current_mode. On Niri, this caused libwayland to abort during startup:

unknown object (...), message current_mode(o)

Mode proxies are now tracked independently from output heads and released when:

  • The mode emits finished
  • The output manager finishes
  • The Wayland connection is cleaned up

Independent tracking avoids relying on cross-object ordering between mode and head finished events.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Build / packaging

Related Issue

N/A

Testing

meson setup build-debug --wipe -Dtests=enabled --buildtype=debug
meson compile -C build-debug
meson test -C build-debug --print-errorlogs
just format

All 68 tests passed. The original startup crash was reproduced, and initialization completed successfully with mode proxies retained on Niri 26.04.

Manual Coverage

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Tested with different bar positions and density settings
  • Tested at different interface scaling values
  • Tested with multiple monitors

Screenshots / Videos

Not applicable; this change has no visual or UI behavior.

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format with clang-format v22+ installed, or this PR has no code changes.
  • I ran the relevant build or test commands, or explained why they were not run.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I will update end-user documentation after merge, or this PR does not change user-facing configuration or behavior.
  • I added or updated assets/translations/en.json, or this PR adds no new user-facing strings.
  • I did not edit non-English translation files unless this PR is explicitly for translation tooling, an import/export sync, or a maintainer-requested locale change.
  • I used the existing canonical names for config keys, IPC names, paths, and identifiers.

@ItsLemmy
ItsLemmy force-pushed the fix/wayland-output-mode-lifetime branch from 128e119 to 3626a81 Compare August 4, 2026 01:08
@ItsLemmy

ItsLemmy commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks a lot, I got hit by the bug and started fixing before seeing your PR.
I'll keep a simplified mix of versions.

@ItsLemmy
ItsLemmy merged commit 0b8e960 into noctalia-dev:main Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants