pop-os / cosmic-randr

Library and utility for displaying and configuring Wayland outputs
Mozilla Public License 2.0
21 stars 1 forks source link

`cosmic-randr` not listing all displays in release build; not correctly using protocol #10

Open ids1024 opened 5 months ago

ids1024 commented 5 months ago

If I run cosmic-randr list in a release build, it often (but not always) lists only two of my three monitors. But generally seems to work in a debug build.

Calling dispatch once doesn't guarantee all events will have been read. A "roundtrip" can guarantee the server has finished responding to requests. But in this case, the correct solution is to wait for zwlr_output_manager_v1::done.

It seems to work if I make it wait for done, but https://wayland.app/protocols/wlr-output-management-unstable-v1#zwlr_output_manager_v1:event:done also defines state to be double buffered. So the library shouldn't expose any changes until done occurs, so changes to multiple objects with multiple events can be handled atomically.