Skip to content
Discussion options

You must be logged in to vote

Solved, now I quit the event_loop directly

self.window.window().on_winit_window_event({
    let no_close = self.settings.no_close;
    move |_w, ev| match ev {
        WindowEvent::CursorLeft { .. } => (!no_close)
+            .then(|| slint::quit_event_loop().ok())
            .flatten()
            .map(|_| EventResult::PreventDefault)
            .unwrap_or(EventResult::Propagate),
        _ => EventResult::Propagate,
    }
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tronical
Comment options

Answer selected by SergioRibera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants