apprt/gtk-ng: address some TODOs
parent
bc731c0ff6
commit
4a4577cf8a
|
|
@ -172,19 +172,23 @@ pub const Tab = extern struct {
|
||||||
.{},
|
.{},
|
||||||
);
|
);
|
||||||
|
|
||||||
// We need to do this so that the title initializes properly,
|
// A tab always starts with a single surface.
|
||||||
// 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
|
|
||||||
const surface: *Surface = .new();
|
const surface: *Surface = .new();
|
||||||
defer surface.unref();
|
defer surface.unref();
|
||||||
_ = surface.refSink();
|
_ = surface.refSink();
|
||||||
const alloc = Application.default().allocator();
|
const alloc = Application.default().allocator();
|
||||||
var tree = Surface.Tree.init(alloc, surface) catch unreachable;
|
if (Surface.Tree.init(alloc, surface)) |tree| {
|
||||||
defer tree.deinit();
|
priv.split_tree.setTree(&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(
|
fn connectSurfaceHandlers(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue