mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
main update to new runtime API
This commit is contained in:
38
src/main.zig
38
src/main.zig
@ -90,33 +90,19 @@ pub fn main() !void {
|
|||||||
try config.finalize();
|
try config.finalize();
|
||||||
std.log.debug("config={}", .{config});
|
std.log.debug("config={}", .{config});
|
||||||
|
|
||||||
if (true) {
|
// Create our app state
|
||||||
// Create our app state
|
var app = try App.create(alloc, &config);
|
||||||
var app = try App.create(alloc, &config);
|
|
||||||
defer app.destroy();
|
|
||||||
|
|
||||||
// Create our runtime app
|
|
||||||
var app_runtime = try apprt.App.init(app, .{});
|
|
||||||
defer app_runtime.terminate();
|
|
||||||
|
|
||||||
// Create an initial window
|
|
||||||
_ = try app_runtime.newWindow();
|
|
||||||
|
|
||||||
// Run the GUI event loop
|
|
||||||
try app_runtime.run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run our app with a single initial window to start.
|
|
||||||
var app = try App.create(alloc, .{}, &config);
|
|
||||||
defer app.destroy();
|
defer app.destroy();
|
||||||
if (build_config.app_runtime == .gtk) {
|
|
||||||
try app.runtime.newWindow();
|
// Create our runtime app
|
||||||
while (true) try app.runtime.wait();
|
var app_runtime = try apprt.App.init(app, .{});
|
||||||
return;
|
defer app_runtime.terminate();
|
||||||
}
|
|
||||||
_ = try app.newWindow(.{});
|
// Create an initial window
|
||||||
try app.run();
|
_ = try app_runtime.newWindow();
|
||||||
|
|
||||||
|
// Run the GUI event loop
|
||||||
|
try app_runtime.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Required by tracy/tracy.zig to enable/disable tracy support.
|
// Required by tracy/tracy.zig to enable/disable tracy support.
|
||||||
|
Reference in New Issue
Block a user