Implement shutdown event for macOS
This commit is contained in:
parent
c470e758cc
commit
983e1b1a70
7 changed files with 25 additions and 6 deletions
|
@ -29,10 +29,16 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
|||
}
|
||||
|
||||
- (void)terminate:(id)sender {
|
||||
if (shouldShutdown_ && !shouldShutdown_.Run())
|
||||
return; // User will call Quit later.
|
||||
AtomApplicationDelegate* atomDelegate = (AtomApplicationDelegate*) [NSApp delegate];
|
||||
[atomDelegate tryToTerminateApp:self];
|
||||
}
|
||||
|
||||
- (void)setShutdownHandler:(base::Callback<bool()>)handler {
|
||||
shouldShutdown_ = std::move(handler);
|
||||
}
|
||||
|
||||
- (BOOL)isHandlingSendEvent {
|
||||
return handlingSendEvent_;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue