From 5669c11a0b651dd79e467de99b16971cbde7135b Mon Sep 17 00:00:00 2001 From: Joel de Vahl Date: Wed, 19 Dec 2007 21:32:58 +0000 Subject: [PATCH] start teewars by default on osx, no launcher yet --- scripts/make_release.py | 2 +- .../external/glfw/lib/macosx/macosx_window.c | 2 +- src/osxlaunch/main.m | 23 ++++++++----------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/make_release.py b/scripts/make_release.py index dcb9b459d..9c92c568b 100644 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -99,7 +99,7 @@ if use_bundle: CFBundleDevelopmentRegion English CFBundleExecutable - TeeLaunch + teewars CFBundleIconFile Teewars CFBundleInfoDictionaryVersion diff --git a/src/engine/external/glfw/lib/macosx/macosx_window.c b/src/engine/external/glfw/lib/macosx/macosx_window.c index b8af0c4e5..f191678a7 100644 --- a/src/engine/external/glfw/lib/macosx/macosx_window.c +++ b/src/engine/external/glfw/lib/macosx/macosx_window.c @@ -707,7 +707,7 @@ int _glfwPlatformOpenWindow( int width, return GL_FALSE; } - if (_glfwLibrary.Unbundled) + //if (_glfwLibrary.Unbundled) { if( GetCurrentProcess( &psn ) != noErr ) { diff --git a/src/osxlaunch/main.m b/src/osxlaunch/main.m index 5f3d6ab65..8d23f5b6e 100644 --- a/src/osxlaunch/main.m +++ b/src/osxlaunch/main.m @@ -3,15 +3,20 @@ @interface ServerView : NSTextView { + NSTask *task; NSFileHandle *file; } -- (void)listenTo: (NSFileHandle*)f; +- (void)listenTo: (NSTask*)t; @end @implementation ServerView -- (void)listenTo: (NSFileHandle*)f; +- (void)listenTo: (NSTask*)t; { - file = f; + NSPipe *pipe; + task = t; + pipe = [NSPipe pipe]; + [task setStandardOutput: pipe]; + file = [pipe fileHandleForReading]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(outputNotification:) name: NSFileHandleReadCompletionNotification object: file]; @@ -35,6 +40,7 @@ -(void)windowWillClose:(NSNotification *)notification { + [task terminate] [NSApp terminate:self]; } @end @@ -49,12 +55,6 @@ int main(int argc, char **argv) NSTask *task; task = [[NSTask alloc] init]; [task setCurrentDirectoryPath: [mainBundle resourcePath]]; - NSPipe *pipe; - NSFileHandle *file; - pipe = [NSPipe pipe]; - [task setStandardOutput: pipe]; - file = [pipe fileHandleForReading]; - if(mod & optionKey) { @@ -82,7 +82,7 @@ int main(int argc, char **argv) [window setDelegate: view]; [window makeKeyAndOrderFront: nil]; - [view listenTo: file]; + [view listenTo: task]; [task setLaunchPath: [mainBundle pathForAuxiliaryExecutable: @"teewars_srv"]]; [task launch]; [NSApp run]; @@ -93,11 +93,8 @@ int main(int argc, char **argv) // run client [task setLaunchPath: [mainBundle pathForAuxiliaryExecutable: @"teewars"]]; [task launch]; - [task waitUntilExit]; } - - [NSApp release]; [pool release]; return(EXIT_SUCCESS);