From 357ad43656bd2ee27ecfac9c33a7751d815c6e70 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 16 Nov 2022 21:20:04 -0800 Subject: [PATCH] app: deinit darwin info --- src/App.zig | 1 + src/Window.zig | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/App.zig b/src/App.zig index fe542d8ee..60e0292a1 100644 --- a/src/App.zig +++ b/src/App.zig @@ -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); } diff --git a/src/Window.zig b/src/Window.zig index f98bc7b8f..1d6beda32 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -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); }