pop-os / cosmic-randr

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

Dispatch awaits indefinitely on other desktop environments #9

Open jfroy opened 10 months ago

jfroy commented 10 months ago

cosmic-randr list hangs on Arch with plasma 6 rc1. It seems to be because the context.dispatch().await does not return in async fn list.

    async fn list(&mut self, kdl: bool) -> Result<(), Box<dyn std::error::Error>> {
        let _res = self.context.dispatch(&mut self.event_queue).await;

In async fn main, event_queue.roundtrip consistently returned 54 on my system when I tested.

rustc 1.72.0 (5680fa18f 2023-08-23)

richardmrodriguez commented 10 months ago

I have noticed that cosmic-randr list also hangs when running on Pop! on Wayland (the GNOME shell Wayland session, not the COSMIC session).

martyfuhry commented 4 months ago

It hangs in COSMIC on Wayland, as well.

wash2 commented 2 days ago

I believe it hangs at https://github.com/pop-os/cosmic-randr/blob/8d0938029f223016fde11aef4c5233ddbfdb2796/lib/src/lib.rs#L64C34-L64C50 or https://github.com/pop-os/cosmic-randr/blob/8d0938029f223016fde11aef4c5233ddbfdb2796/lib/src/lib.rs#L102 when calling dispatch_pending. It could be a bug in wayland_client, or maybe a small usage mistake in cosmic-randr, but I'm not sure yet.

wash2 commented 1 day ago

Ahh it's actually the tachyonix channel that seems to fill up and then a callback blocks on the send while dispatching. Increasing the channel size should fix the issue, or using an unbounded channel.