aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/mac-screen.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw/mac-screen.m')
-rw-r--r--src/cmd/devdraw/mac-screen.m25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/cmd/devdraw/mac-screen.m b/src/cmd/devdraw/mac-screen.m
index e02a2524..c6e58341 100644
--- a/src/cmd/devdraw/mac-screen.m
+++ b/src/cmd/devdraw/mac-screen.m
@@ -510,7 +510,7 @@ void
rpc_resizeimg(Client *c)
{
DrawView *view = (__bridge DrawView*)c->view;
- dispatch_sync(dispatch_get_main_queue(), ^(void){
+ dispatch_async(dispatch_get_main_queue(), ^(void){
[view resizeimg];
});
}
@@ -518,7 +518,6 @@ rpc_resizeimg(Client *c)
- (void)resizeimg {
[self initimg];
gfx_replacescreenimage(self.client, self.img);
- [self sendmouse:0];
}
- (void)windowDidResize:(NSNotification *)notification {
@@ -561,6 +560,10 @@ rpc_resizewindow(Client *c, Rectangle r)
[self sendmouse:0];
}
+- (void)windowDidResignKey:(id)arg {
+ gfx_abortcompose(self.client);
+}
+
- (void)mouseMoved:(NSEvent*)e{ [self getmouse:e];}
- (void)mouseDown:(NSEvent*)e{ [self getmouse:e];}
- (void)mouseDragged:(NSEvent*)e{ [self getmouse:e];}
@@ -930,6 +933,13 @@ rpc_setmouse(Client *c, Point p)
- (NSApplicationPresentationOptions)window:(id)arg
willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions {
+ // The default for full-screen is to auto-hide the dock and menu bar,
+ // but the menu bar in particular comes back when the cursor is just
+ // near the top of the screen, which makes acme's top tag line very difficult to use.
+ // Disable the menu bar entirely.
+ // In theory this code disables the dock entirely too, but if you drag the mouse
+ // down far enough off the bottom of the screen the dock still unhides.
+ // That's OK.
NSApplicationPresentationOptions o;
o = proposedOptions;
o &= ~(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar);
@@ -938,16 +948,21 @@ rpc_setmouse(Client *c, Point p)
}
- (void)windowWillEnterFullScreen:(NSNotification*)notification {
- // TODO: This should only be done if the window
- // is on the screen with the dock.
- // But how can you tell which window has the dock?
+ // This is a heavier-weight way to make sure the menu bar and dock go away,
+ // but this affects all screens even though the app is running on full screen
+ // on only one screen, so it's not great. The behavior from the
+ // willUseFullScreenPresentationOptions seems to be enough for now.
+ /*
[[NSApplication sharedApplication]
setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock];
+ */
}
- (void)windowDidExitFullScreen:(NSNotification*)notification {
+ /*
[[NSApplication sharedApplication]
setPresentationOptions:NSApplicationPresentationDefault];
+ */
}
@end