Implement new_event_loop_proxy for PluginCanvasPlatform#11
Conversation
|
Hey, thanks for the PRs. Just FYI I'm quite busy with my plugin release right now so might take a while to review especially the larger standalone build PR. |
|
Sure thing. Nothing's urgent here. Good luck with the release! |
9f2257c to
70495c8
Compare
70495c8 to
00d1902
Compare
... which is needed for `slint::invoke_from_event_loop` and co
|
I don't think the order is important here, and also not which window actually pulls and applies the event. Main purpose of If an event references a window, it must pass a weak ref to the window anyway and check if it's still valid. Just like https://docs.rs/slint/latest/slint/struct.Weak.html#method.upgrade_in_event_loop does. Also I don't see how to access PluginCanvasWindowAdapter within |
|
Good point, this is similar to the slint limitation which made me use thread locals when generating window adapters (which is fragily in theory but probably works in practice). We can keep this as is. Maybe add a comment explaining that this is making plugin instances share the event queue which isn't ideal but current slint limitations don't allow us to separate them. |
00d1902 to
2cd426f
Compare
This is needed for
slint::invoke_from_event_loopand similar functions to work.I started using
invoke_from_event_loopand wondered why it didn't work. The missing impl can be worked around by adding a custom thread-safe event queue in custom editors, but it's nice to use the well-documented Slint feature instead.