app: deinit darwin info

This commit is contained in:
Mitchell Hashimoto
2022-11-16 21:20:04 -08:00
parent b4d5901225
commit 357ad43656
2 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,7 @@ pub fn destroy(self: *App) void {
// Clean up all our windows
for (self.windows.items) |window| window.destroy();
self.windows.deinit(self.alloc);
if (comptime builtin.target.isDarwin()) self.darwin.deinit();
self.mailbox.destroy(self.alloc);
self.alloc.destroy(self);
}

View File

@ -136,7 +136,12 @@ pub fn create(alloc: Allocator, app: *App, config: *const Config) !*Window {
if (comptime builtin.target.isDarwin()) {
const NSWindowTabbingMode = enum(usize) { automatic = 0, preferred = 1, disallowed = 2 };
const nswindow = objc.Object.fromId(glfwNative.getCocoaWindow(window).?);
// Tabbing mode enables tabbing at all
nswindow.setProperty("tabbingMode", NSWindowTabbingMode.automatic);
// All windows within a tab bar must have a matching tabbing ID.
// The app sets this up for us.
nswindow.setProperty("tabbingIdentifier", app.darwin.tabbing_id);
}