mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-04 21:30:27 +00:00
#13611 Route new-tab window presentation through an Objective-C exception catcher. AppKit can raise an NSInternalInconsistencyException while selecting a new tab in native fullscreen. Catch the presentation exception, report it through the existing error logging path, and leave Ghostty running when AppKit’s fullscreen window stack is inconsistent. This was pretty hard to reproduce but I was able to reproduce it about 1/3rd of the time via AppleScript automation...
21 lines
634 B
Objective-C
21 lines
634 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
/// This file contains wrappers around various ObjC functions so we can catch
|
|
/// exceptions, since you can't natively catch ObjC exceptions from Swift
|
|
/// (at least at the time of writing this comment).
|
|
|
|
/// NSWindow.addTabbedWindow wrapper
|
|
FOUNDATION_EXPORT BOOL GhosttyAddTabbedWindowSafely(
|
|
id _Nonnull parent,
|
|
id _Nonnull child,
|
|
NSInteger ordered,
|
|
NSError * _Nullable * _Nullable error
|
|
);
|
|
|
|
/// NSWindowController.showWindow wrapper
|
|
FOUNDATION_EXPORT BOOL GhosttyShowWindowSafely(
|
|
id _Nonnull controller,
|
|
id _Nullable sender,
|
|
NSError * _Nullable * _Nullable error
|
|
);
|