aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Jeannot <djeannot24@gmail.com>2012-01-16 17:11:36 -0500
committerRuss Cox <rsc@swtch.com>2012-01-16 17:11:36 -0500
commit10ccf8df0c884dcc07b52fdd1bff77f149170dd2 (patch)
treea4f095f4d1487e7b10f5be22b6ed47a47b1cc679 /src
parent73b0f029e107c2d015ebb48d59d32f264973de49 (diff)
downloadplan9port-10ccf8df0c884dcc07b52fdd1bff77f149170dd2.tar.gz
plan9port-10ccf8df0c884dcc07b52fdd1bff77f149170dd2.tar.bz2
plan9port-10ccf8df0c884dcc07b52fdd1bff77f149170dd2.zip
devdraw: OS X: neutralize menu and Dock bugs in fullscreen mode
Previously, the menu bar has been set to hidden instead of autohidden in fullscreen mode, because it appeared too easily. Occasionally however, it still appears. This patch makes sure it won't. With OS X Lion's fullscreen, the Dock is autohidden, but sometimes remains hidden. This bug comes with visual menu bar bugs during space transition and when exiting fullscreen. Those bugs happen after each Devdraw's activation, for example. This patch neutralizes them. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5502091
Diffstat (limited to 'src')
-rw-r--r--src/cmd/devdraw/cocoa-screen.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/devdraw/cocoa-screen.m b/src/cmd/devdraw/cocoa-screen.m
index 9684360c..f27c41dd 100644
--- a/src/cmd/devdraw/cocoa-screen.m
+++ b/src/cmd/devdraw/cocoa-screen.m
@@ -133,9 +133,6 @@ static NSCursor* makecursor(Cursor*);
}
- (void)windowDidBecomeKey:(id)arg
{
- if(win.isnfs || win.isofs)
- hidebars(1);
-
in.touchevent = 0;
getmousepos();
@@ -685,6 +682,9 @@ getmousepos(void)
in.mpos.y = round(p.y);
updatecursor();
+
+ if(win.isnfs || win.isofs)
+ hidebars(1);
}
static void
@@ -1096,6 +1096,12 @@ hidebars(int set)
s0 = [[NSScreen screens] objectAtIndex:0];
old = [NSApp presentationOptions];
+#if OSX_VERSION >= 100700
+ /* This bit can get lost, resulting in dreadful bugs. */
+ if(win.isnfs)
+ old |= NSApplicationPresentationFullScreen;
+#endif
+
if(set && s==s0)
opt = (old & ~Autohiddenbars) | Hiddenbars;
else