summaryrefslogtreecommitdiff
path: root/src/App.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2024-10-18 08:14:40 -0700
committerMitchell Hashimoto <m@mitchellh.com>2024-10-18 08:21:42 -0700
commit463f4afc0529f3992aecdf552cfe0f3e81796722 (patch)
tree3851355c931ef7c253f5971b0c99b36a8ea09464 /src/App.zig
parent940a46d41f8cc6a92f2f8f93b108d556410e22f2 (diff)
apprt/glfw: exit with invalid CLI args
Diffstat (limited to 'src/App.zig')
-rw-r--r--src/App.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/App.zig b/src/App.zig
index b1ea2eb7b..0f9a0d89b 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -231,10 +231,19 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void {
.open_config => try self.performAction(rt_app, .open_config),
.new_window => |msg| try self.newWindow(rt_app, msg),
.close => |surface| self.closeSurface(surface),
- .quit => self.setQuit(),
.surface_message => |msg| try self.surfaceMessage(msg.surface, msg.message),
.redraw_surface => |surface| self.redrawSurface(rt_app, surface),
.redraw_inspector => |surface| self.redrawInspector(rt_app, surface),
+
+ // If we're quitting, then we set the quit flag and stop
+ // draining the mailbox immediately. This lets us defer
+ // mailbox processing to the next tick so that the apprt
+ // can try to quick as quickly as possible.
+ .quit => {
+ log.info("quit message received, short circuiting mailbox drain", .{});
+ self.setQuit();
+ return;
+ },
}
}
}