[NSApplication -run]: only execute launch sequence on first call; unhide mouse on application exit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21162 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adrian Robert 2005-04-27 04:22:31 +00:00
parent ad5f9128c7
commit cc5f3e4939
3 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2005-04-27 Adrian Robert <arobert@cogsci.ucsd.edu>
* Headers/AppKit/NSApplication.h: Add app_is_launched ivar.
* Source/NSApplication.m (-run): Only go through launch process
and call -finishLaunching on first call.
(-replyToApplicationShouldTerminate:) Unhide mouse on app exit.
2005-04-25 Adam Fedor <fedor@gnu.org>
* configure.ac: Check for lib portaudio

View file

@ -98,7 +98,8 @@ APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode;
id _listener;
NSMenu *_main_menu;
NSMenu *_windows_menu;
// 5 bits
// 6 bits
BOOL _app_is_launched;
BOOL _app_is_running;
BOOL _app_is_active;
BOOL _app_is_hidden;

View file

@ -1147,18 +1147,23 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
format: @"NSApp's run called recursively"];
}
IF_NO_GC(_runLoopPool = [arpClass new]);
/*
* Set this flag here in case the application is actually terminated
* inside -finishLaunching.
*/
_app_is_running = YES;
[self finishLaunching];
if (_app_is_launched == NO)
{
_app_is_launched = YES;
IF_NO_GC(_runLoopPool = [arpClass new]);
[_listener updateServicesMenu];
[_main_menu update];
DESTROY(_runLoopPool);
[self finishLaunching];
[_listener updateServicesMenu];
[_main_menu update];
DESTROY(_runLoopPool);
}
while (_app_is_running)
{
@ -2718,6 +2723,7 @@ image.
_app_is_running = NO;
[[self windows] makeObjectsPerformSelector: @selector(close)];
[NSCursor setHiddenUntilMouseMoves: NO];
/* Store our user information. */
[[NSUserDefaults standardUserDefaults] synchronize];