mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
apprt/gtk: get rid of one newsurface call
This commit is contained in:
@ -280,7 +280,7 @@ fn realize(self: *Surface) !void {
|
||||
|
||||
pub fn destroy(self: *Surface, alloc: Allocator) void {
|
||||
self.deinit();
|
||||
alloc.free(self);
|
||||
alloc.destroy(self);
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Surface) void {
|
||||
|
@ -90,8 +90,12 @@ pub fn init(self: *Tab, window: *Window, parent_: ?*CoreSurface) !void {
|
||||
self.box = @ptrCast(box_widget);
|
||||
|
||||
// Create the initial surface since all tabs start as a single non-split
|
||||
const surface = try self.newSurface(parent_);
|
||||
errdefer surface.deinit();
|
||||
var surface = try Surface.create(window.app.core_app.alloc, window.app, .{
|
||||
.parent2 = parent_,
|
||||
.parent = .{ .tab = self },
|
||||
});
|
||||
errdefer surface.destroy(window.app.core_app.alloc);
|
||||
surface.setContainer(.{ .tab_ = self });
|
||||
self.child = .{ .surface = surface };
|
||||
|
||||
// Add Surface to the Tab
|
||||
|
Reference in New Issue
Block a user