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 {
|
pub fn destroy(self: *Surface, alloc: Allocator) void {
|
||||||
self.deinit();
|
self.deinit();
|
||||||
alloc.free(self);
|
alloc.destroy(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deinit(self: *Surface) void {
|
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);
|
self.box = @ptrCast(box_widget);
|
||||||
|
|
||||||
// Create the initial surface since all tabs start as a single non-split
|
// Create the initial surface since all tabs start as a single non-split
|
||||||
const surface = try self.newSurface(parent_);
|
var surface = try Surface.create(window.app.core_app.alloc, window.app, .{
|
||||||
errdefer surface.deinit();
|
.parent2 = parent_,
|
||||||
|
.parent = .{ .tab = self },
|
||||||
|
});
|
||||||
|
errdefer surface.destroy(window.app.core_app.alloc);
|
||||||
|
surface.setContainer(.{ .tab_ = self });
|
||||||
self.child = .{ .surface = surface };
|
self.child = .{ .surface = surface };
|
||||||
|
|
||||||
// Add Surface to the Tab
|
// Add Surface to the Tab
|
||||||
|
Reference in New Issue
Block a user