aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-14 12:06:34 -0500
committerRuss Cox <rsc@swtch.com>2020-01-14 12:06:34 -0500
commit4c54893156cf2489081fe63eb37a0e4d3ede1e05 (patch)
tree1d9889d7d0f55746c93a4e295bc335c2272d92cb /src/cmd/devdraw
parent3d1382b98a502d0c34d5ba2c462396acc515016e (diff)
downloadplan9port-4c54893156cf2489081fe63eb37a0e4d3ede1e05.tar.gz
plan9port-4c54893156cf2489081fe63eb37a0e4d3ede1e05.tar.bz2
plan9port-4c54893156cf2489081fe63eb37a0e4d3ede1e05.zip
devdraw: do not force-hide menu and dock during full screen on mac
This hides the menu on dock on all screens which is more than we want. The code was added to fix a problem with Catalina that I can no longer reproduce, so I guess it works now. Fixes #336.
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r--src/cmd/devdraw/mac-screen.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/cmd/devdraw/mac-screen.m b/src/cmd/devdraw/mac-screen.m
index e02a2524..5e23c43a 100644
--- a/src/cmd/devdraw/mac-screen.m
+++ b/src/cmd/devdraw/mac-screen.m
@@ -930,6 +930,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 +945,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