mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
macOS: reduce mechanism to create windows back to one
This commit is contained in:
@ -2119,15 +2119,11 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !void
|
|||||||
} else log.warn("dev mode was not compiled into this binary", .{}),
|
} else log.warn("dev mode was not compiled into this binary", .{}),
|
||||||
|
|
||||||
.new_window => {
|
.new_window => {
|
||||||
if (@hasDecl(apprt.Surface, "newWindow")) {
|
_ = self.app_mailbox.push(.{
|
||||||
try self.rt_surface.newWindow();
|
.new_window = .{
|
||||||
} else {
|
.parent = self,
|
||||||
_ = self.app_mailbox.push(.{
|
},
|
||||||
.new_window = .{
|
}, .{ .instant = {} });
|
||||||
.parent = self,
|
|
||||||
},
|
|
||||||
}, .{ .instant = {} });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
.new_tab => {
|
.new_tab => {
|
||||||
|
@ -151,6 +151,17 @@ pub const App = struct {
|
|||||||
_ = surface;
|
_ = surface;
|
||||||
// No-op, we use a threaded interface so we're constantly drawing.
|
// No-op, we use a threaded interface so we're constantly drawing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn newWindow(self: *App, parent: ?*CoreSurface) !void {
|
||||||
|
_ = self;
|
||||||
|
|
||||||
|
// Right now we only support creating a new window with a parent
|
||||||
|
// through this code.
|
||||||
|
// The other case is handled by the embedding runtime.
|
||||||
|
if (parent) |surface| {
|
||||||
|
try surface.rt_surface.newWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Surface = struct {
|
pub const Surface = struct {
|
||||||
|
Reference in New Issue
Block a user