devdraw: fix title and "open in top" on OS X

On OSX 10.10, when you open an application that depends on devdraw, the
title bar only shows the first letter of the application's name. The
patch sets a default title as soon as the window is created, which
fixes this issue.

On OSX 10.10, when you open an application that depends on devdraw, this
application is opened in top of other windows, however the menu bar is
not updated. The patch calls topwin() at the end of makewin() in
src/cmd/devdraw/cocoa-screen.m .

Change-Id: Ie036928b5574c8df20ad8b2b54047e2f7a22bb41
Reviewed-on: https://plan9port-review.googlesource.com/1091
Reviewed-by: Russ Cox <rsc@swtch.com>
This commit is contained in:
Roi Martin 2014-11-16 01:02:57 +01:00 committed by Russ Cox
parent 679d176fea
commit d3a47e14e5

View file

@ -98,7 +98,6 @@ threadmain(int argc, char **argv)
[NSApplication sharedApplication]; [NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp setDelegate:[appdelegate new]]; [NSApp setDelegate:[appdelegate new]];
[NSApp activateIgnoringOtherApps:YES];
[NSApp run]; [NSApp run];
} }
@ -345,6 +344,8 @@ makewin(char *s)
initWithContentRect:r initWithContentRect:r
styleMask:Winstyle styleMask:Winstyle
backing:NSBackingStoreBuffered defer:NO]; backing:NSBackingStoreBuffered defer:NO];
[w setTitle:@"devdraw"];
if(!set) if(!set)
[w center]; [w center];
#if OSX_VERSION >= 100700 #if OSX_VERSION >= 100700
@ -366,6 +367,8 @@ makewin(char *s)
win.isofs = 0; win.isofs = 0;
win.content = [contentview new]; win.content = [contentview new];
[WIN setContentView:win.content]; [WIN setContentView:win.content];
topwin();
} }
static Memimage* static Memimage*