1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00

macos: the event loop would keep running until mouse moved after quit

On macos, once all panes were closed, the GUI would request that the app
stop, but it wouldn't actually exit until a UI event occurred.

This was mostly noticeable when running debug builds from another
terminal.

Calling NSApp::abortModal is sufficient to knock us out of that state.
This commit is contained in:
Wez Furlong 2021-04-03 14:57:20 -07:00
parent 7deb215303
commit 1658627e2c

View File

@ -77,6 +77,9 @@ impl ConnectionOps for Connection {
fn terminate_message_loop(&self) {
unsafe {
let () = msg_send![NSApp(), stop: nil];
// Generate a UI event so that the run loop breaks out
// after receiving the stop
let () = msg_send![NSApp(), abortModal];
}
}