-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add poll_events
API to cooperate with other event loop
#2763
Comments
poll_events
API to integrate with other event looppoll_events
API to cooperate with other event loop
Yes, perhaps this is doable. What's a little tricky is that neither with Qt nor with Winit we can get the file descriptors needed for polling. Could you describe a little how your ideal setup would look like? |
I don't think it has anything to do with file descriptors here. A |
At what point should |
There are several strategies:
These are very common usecases in an eventloop based programming model. In other frameworks, an event loop is always combined with a
It's the users' duty to avoid a busy loop in case of using a |
Right, so you'd basically run a while loop that first polls Slint, then polls SDL, then maybe libuv - each with a timeout one after the other? It's not optimal, but probably acceptable for many :-) We could offer this, indeed - using processEvents() with Qt and |
Yes, users who use this api should take care about the caveats themeselves. |
This is specifically incompatible with target environments where the platform owns the event loop. This includes every web browser, Windows, MacOS, and both major mobile platforms. Slint could offer a |
Then alternatively, Slint could provide a hook method to support this. |
Maybe it would be useful to understand the exact use-case and how we can solve it. |
I'm using C++ API, need a
slint::poll_events
API to integrate with other event system like SDL2 or libuv. Currently there is a workaround by using a repeat timer. But I'm glad to see there would be a dedicate API for this purpose.The text was updated successfully, but these errors were encountered: