apprt/gtk-ng: address some TODOs

pull/8165/head
Mitchell Hashimoto 2025-08-06 13:57:14 -07:00
parent bc731c0ff6
commit 4a4577cf8a
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 13 additions and 9 deletions

View File

@ -172,19 +172,23 @@ pub const Tab = extern struct {
.{},
);
// We need to do this so that the title initializes properly,
// I think because its a dynamic getter.
self.as(gobject.Object).notifyByPspec(properties.@"active-surface".impl.param_spec);
// Setup our initial split tree.
// TODO: Probably make this a property
// A tab always starts with a single surface.
const surface: *Surface = .new();
defer surface.unref();
_ = surface.refSink();
const alloc = Application.default().allocator();
var tree = Surface.Tree.init(alloc, surface) catch unreachable;
defer tree.deinit();
priv.split_tree.setTree(&tree);
if (Surface.Tree.init(alloc, surface)) |tree| {
priv.split_tree.setTree(&tree);
// Hacky because we need a non-const result.
var mut = tree;
mut.deinit();
} else |_| {
// TODO: We should make our "no surfaces" state more aesthetically
// pleasing and show something like an "Oops, something went wrong"
// message. For now, this is incredibly unlikely.
@panic("oom");
}
}
fn connectSurfaceHandlers(