From 7e9dce054f39c3b44a70f9c8d6fbfd3f8ec80b03 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Sun, 26 Nov 2023 13:18:43 +0100 Subject: [PATCH] gtk: remove unneeded method setContainer on Surface We don't need to update the titles, etc. since that's done by `grabFocus` and that then makes the method not that useful. Removing for now. --- src/apprt/gtk/Surface.zig | 9 +++------ src/apprt/gtk/Tab.zig | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index b0b317199..2286ecd2b 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -403,12 +403,9 @@ pub fn unref(self: *Surface) void { c.g_object_unref(self.gl_area); } -// 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? +pub fn destroy(self: *Surface, alloc: Allocator) void { + self.deinit(); + alloc.destroy(self); } fn render(self: *Surface) !void { diff --git a/src/apprt/gtk/Tab.zig b/src/apprt/gtk/Tab.zig index 4b7ef5ccb..d8c006ce7 100644 --- a/src/apprt/gtk/Tab.zig +++ b/src/apprt/gtk/Tab.zig @@ -97,7 +97,7 @@ pub fn init(self: *Tab, window: *Window, parent_: ?*CoreSurface) !void { .parent2 = parent_, }); errdefer surface.unref(); - surface.setContainer(.{ .tab_ = self }); + surface.container = .{ .tab_ = self }; self.elem = .{ .surface = surface }; // Add Surface to the Tab