mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
apprt/gtk: remove tab option from surface
This commit is contained in:
@ -28,9 +28,6 @@ const log = std.log.scoped(.gtk_surface);
|
||||
pub const opengl_single_threaded_draw = true;
|
||||
|
||||
pub const Options = struct {
|
||||
/// The tab that this surface is attached to.
|
||||
tab: *Tab,
|
||||
|
||||
/// The parent this surface is created under.
|
||||
parent: Parent,
|
||||
|
||||
@ -190,7 +187,7 @@ pub fn init(self: *Surface, app: *App, opts: Options) !void {
|
||||
// Build our result
|
||||
self.* = .{
|
||||
.app = app,
|
||||
.container = .{ .tab_ = opts.tab },
|
||||
.container = .{ .none = {} },
|
||||
.parent = opts.parent,
|
||||
.gl_area = opts.gl_area,
|
||||
.title_text_buf = undefined,
|
||||
@ -290,6 +287,14 @@ pub fn deinit(self: *Surface) void {
|
||||
if (self.cursor) |cursor| c.g_object_unref(cursor);
|
||||
}
|
||||
|
||||
// TODO: move this
|
||||
/// Change the container for the surface to `container`.
|
||||
pub fn setContainer(self: *Surface, container: Container) void {
|
||||
self.container = container;
|
||||
|
||||
// TODO: do we need to ever update our title or anything here?
|
||||
}
|
||||
|
||||
fn render(self: *Surface) !void {
|
||||
try self.core_surface.renderer.drawFrame(self);
|
||||
}
|
||||
|
@ -168,7 +168,6 @@ pub fn newSurface(self: *Tab, parent_: ?*CoreSurface) !*Surface {
|
||||
c.gtk_widget_set_vexpand(gl_area, 1);
|
||||
|
||||
try surface.init(self.window.app, .{
|
||||
.tab = self,
|
||||
.parent = .{
|
||||
.tab = self,
|
||||
},
|
||||
@ -176,6 +175,7 @@ pub fn newSurface(self: *Tab, parent_: ?*CoreSurface) !*Surface {
|
||||
.gl_area = @ptrCast(gl_area),
|
||||
.font_size = font_size,
|
||||
});
|
||||
surface.setContainer(.{ .tab_ = self });
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
Reference in New Issue
Block a user