aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/cocoa-screen.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw/cocoa-screen.m')
-rw-r--r--src/cmd/devdraw/cocoa-screen.m16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cmd/devdraw/cocoa-screen.m b/src/cmd/devdraw/cocoa-screen.m
index 4d664059..ae7f5971 100644
--- a/src/cmd/devdraw/cocoa-screen.m
+++ b/src/cmd/devdraw/cocoa-screen.m
@@ -105,6 +105,7 @@ struct
int mscroll;
int undo;
int touchevent;
+ int willactivate;
} in;
static void hidebars(int);
@@ -165,6 +166,7 @@ static NSCursor* makecursor(Cursor*);
{
return YES;
}
+- (void)applicationDidBecomeActive:(id)arg{ in.willactivate = 0;}
- (void)windowDidEnterFullScreen:(id)arg{ win.isnfs = 1; hidebars(1);}
- (void)windowWillExitFullScreen:(id)arg{ win.isnfs = 0; hidebars(0);}
- (void)windowDidExitFullScreen:(id)arg
@@ -1014,7 +1016,7 @@ setmouse(Point p)
NSPoint q;
NSRect r;
- if([NSApp isActive] == 0)
+ if([NSApp isActive]==0 && in.willactivate==0)
return;
if(first){
@@ -1282,3 +1284,15 @@ makecursor(Cursor *c)
[i release];
return d;
}
+
+void
+topwin(void)
+{
+ [WIN performSelectorOnMainThread:
+ @selector(makeKeyAndOrderFront:)
+ withObject:nil
+ waitUntilDone:NO];
+
+ in.willactivate = 1;
+ [NSApp activateIgnoringOtherApps:YES];
+}