Skip to content
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

macOS app quits after closing first frame on sciter 5 #142

Open
Andrew-Shay opened this issue Sep 30, 2023 · 0 comments
Open

macOS app quits after closing first frame on sciter 5 #142

Andrew-Shay opened this issue Sep 30, 2023 · 0 comments

Comments

@Andrew-Shay
Copy link

https://sciter.com/forums/topic/macos-program-quits-after-closing-1st-frame/

On macOS, if I attempt to start a second frame, after closing the first one, the entire program quits.
But on Windows, the second frame appears right after closing the first.

https://transmitic.net/sciterhelp/double-win.mp4
https://transmitic.net/sciterhelp/double-mac.mp4

https://transmitic.net/sciterhelp/test-sciter-double-win.zip
https://transmitic.net/sciterhelp/test-sciter-double-mac.zip
$ cargo run

Windows 10 22H2
macOS Monterey 12.6.8

sciter 71c817892a37d7e5a8976a3a3b24b0c555829e98

Rust 1.71.1
sciter-rs = "0.5.58"
libc = "0.2.147"
lazy_static = "1.4"

Quoting Andrew

For some reasons, this:

let mut frame = sciter::Window::new();

Creates sciter's window with SW_MAIN flag.

Closing main window causes [NSApp stop:nil] call. Seems like Cocoa cannot restart shared application (NSApp). Or even quits from main before that.

Solution is to start main window in hidden state, create secondary window from script and show main after secondary closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant