summary refs log tree commit diff
path: root/bin/gfcocoa.m
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-07 12:07:01 -0500
committerJune McEnroe <june@causal.agency>2018-02-07 12:07:01 -0500
commitb6409bf711c315bb910346fb4183717add00c843 (patch)
treea2e71f058b88d06b08a7743663dc7b3517942473 /bin/gfcocoa.m
parentRename title to status in gfcocoa (diff)
downloadsrc-b6409bf711c315bb910346fb4183717add00c843.tar.gz
src-b6409bf711c315bb910346fb4183717add00c843.zip
Exit by returning false from input to gf{b,cocoa}
I haven't built gfb yet, so a fix commit is probably incoming.
Diffstat (limited to 'bin/gfcocoa.m')
-rw-r--r--bin/gfcocoa.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/gfcocoa.m b/bin/gfcocoa.m
index 23136d0a..d3d2ef46 100644
--- a/bin/gfcocoa.m
+++ b/bin/gfcocoa.m
@@ -16,6 +16,7 @@
 
 #import <Cocoa/Cocoa.h>
 #import <err.h>
+#import <stdbool.h>
 #import <stdint.h>
 #import <stdlib.h>
 #import <sysexits.h>
@@ -25,7 +26,7 @@
 extern int init(int argc, char *argv[]);
 extern const char *status(void);
 extern void draw(uint32_t *buf, size_t xres, size_t yres);
-extern void input(char in);
+extern bool input(char in);
 
 @interface BufferView : NSView {
     size_t bufSize;
@@ -94,7 +95,9 @@ extern void input(char in);
         remainingRange: NULL
     ];
     if (converted) {
-        input(in);
+        if (!input(in)) {
+            [NSApp terminate: self];
+        }
         [self setWindowTitle];
         [self draw];
     }