mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-27 19:16:27 +00:00
macos: change our minimum version to macOS 13
macOS 12 is officially EOL by Apple and the project only supports officially supported versions of macOS. Once publicly released, users on older macOS versions will have to use older released builds.
This commit is contained in:
@@ -559,25 +559,15 @@ pub const Surface = struct {
|
||||
// Clean up our core surface so that all the rendering and IO stop.
|
||||
self.core_surface.deinit();
|
||||
|
||||
var tabgroup_opt: if (App.Darwin.enabled) ?objc.Object else void = undefined;
|
||||
if (App.Darwin.enabled) {
|
||||
const nswindow = objc.Object.fromId(glfwNative.getCocoaWindow(self.window).?);
|
||||
const tabgroup = nswindow.getProperty(objc.Object, "tabGroup");
|
||||
|
||||
// On macOS versions prior to Ventura, we lose window focus on tab close
|
||||
// for some reason. We manually fix this by keeping track of the tab
|
||||
// group and just selecting the next window.
|
||||
if (internal_os.macosVersionAtLeast(13, 0, 0))
|
||||
tabgroup_opt = null
|
||||
else
|
||||
tabgroup_opt = tabgroup;
|
||||
|
||||
const windows = tabgroup.getProperty(objc.Object, "windows");
|
||||
switch (windows.getProperty(usize, "count")) {
|
||||
// If we're going down to one window our tab bar is going to be
|
||||
// destroyed so unset it so that the later logic doesn't try to
|
||||
// use it.
|
||||
1 => tabgroup_opt = null,
|
||||
1 => {},
|
||||
|
||||
// If our tab bar is visible and we are going down to 1 window,
|
||||
// hide the tab bar. The check is "2" because our current window
|
||||
@@ -597,15 +587,6 @@ pub const Surface = struct {
|
||||
c.destroy();
|
||||
self.cursor = null;
|
||||
}
|
||||
|
||||
// If we have a tabgroup set, we want to manually focus the next window.
|
||||
// We should NOT have to do this usually, see the comments above.
|
||||
if (App.Darwin.enabled) {
|
||||
if (tabgroup_opt) |tabgroup| {
|
||||
const selected = tabgroup.getProperty(objc.Object, "selectedWindow");
|
||||
selected.msgSend(void, objc.sel("makeKeyWindow"), .{});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if the glfw window is in fullscreen.
|
||||
|
||||
Reference in New Issue
Block a user