mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-27 09:31:39 +00:00
Improve quit timers.
Instead of "polling" to see if a quit timer has expired, start a single timer that expires after the confiugred delay when no more surfaces are open. That timer can be cancelled if necessary.
This commit is contained in:
@@ -107,6 +107,11 @@ pub fn main() !MainReturn {
|
||||
var app_runtime = try apprt.App.init(app, .{});
|
||||
defer app_runtime.terminate();
|
||||
|
||||
// Since - by definition - there are no surfaces when first started, the
|
||||
// quit timer may need to be started. The start timer will get cancelled if/
|
||||
// when the first surface is created.
|
||||
if (@hasDecl(apprt.App, "startQuitTimer")) app_runtime.startQuitTimer();
|
||||
|
||||
// Run the GUI event loop
|
||||
try app_runtime.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user