Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Rewrite GTK UI & Fix GTK UI Hang #62
Edit: Yes, this is the issue.
I suspect it's due to a card reader returning
I thought it might fix it. The previous design of the event system had potential for getting stuck in a lock, due to the large amounts of threads locking and unlocking the same locks in the background. Dynamically checking for the need to refresh devices on the device list caused a lot of overhead in additional bookkeeping.
The new design simply sends all UI events through channels to a single background thread, which later responds through a channel to a single GTK event loop in the main thread. That way, clicking a button doesn't spawn a new thread, but queues a new event to be handled in the background on an existing thread.
Seems those working on the GLib bindings for Rust have come to a similar conclusion, that a channel-based approach is more ideal for handling UI events. A new version of glib-rs will have it's own channel mechanism that can register with the glib main event loop.