Replace gbulb with a direct GTK main loop integration. #2548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GBulb has a number of bugs logged against it; new versions of Python are particularly affected, due to changes in the underlying CPython asyncio libraries.
Gbulb is based on the idea of making the GTK event loop the main loop, and then trying to re-implement asyncio functionality using Glib primitives. This that the bulk of GBulb is a re-implementation of basic socket handling that ascynio has out-of-the-box.
This PR takes the other approach; try to integrate GTK into the asyncio event loop. GTKApplication.run() has a fairly simple implementation, so this seems like it could be a lot more reliable (and avoid any future issues of asyncio updates).
The one notable downside to this approach is that there is a
sleep()
involved; this means there is an inherent "delay" in responding to events. Reducing this delay causes the event loop to thrash, so there's a balance between the length of the delay and the responsiveness of the app.PR Checklist: