mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Fix restarting the event loop with the GL backend
We must reset the proxy to a queue so one can restart it with pending events
This commit is contained in:
parent
9d0efd243e
commit
0034a3e67d
2 changed files with 8 additions and 3 deletions
|
@ -28,7 +28,7 @@ TEST_CASE("C++ Timers")
|
|||
}
|
||||
|
||||
|
||||
SCENARIO("Quit from event")
|
||||
TEST_CASE("Quit from event")
|
||||
{
|
||||
int called = 0;
|
||||
sixtyfps::invoke_from_event_loop([&] {
|
||||
|
@ -41,7 +41,7 @@ SCENARIO("Quit from event")
|
|||
}
|
||||
|
||||
|
||||
SCENARIO("Event from thread")
|
||||
TEST_CASE("Event from thread")
|
||||
{
|
||||
std::atomic<int> called = 0;
|
||||
auto t = std::thread([&] {
|
||||
|
|
|
@ -517,7 +517,12 @@ pub fn run(quit_behavior: sixtyfps_corelib::backend::EventLoopQuitBehavior) {
|
|||
};
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
winit_loop.run_return(run_fn);
|
||||
|
||||
*GLOBAL_PROXY.get_or_init(Default::default).lock().unwrap() = Default::default();
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
// Since wasm does not have a run_return function that takes a non-static closure,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue