Suppress app icon window by simply not ordering it in.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28831 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-10-17 05:35:56 +00:00
parent 32c94cae17
commit 11ad2da52b
4 changed files with 37 additions and 19 deletions

View file

@ -1,3 +1,13 @@
2009-10-17 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSApplication.m: Make GSSuppressAppIconhide the icon window
(leave it ordered out) rather than making it not exist at all.
Add new default GSBackgroundApp for an application which should not
display the window at all.
* Soure/NSWindow.m: Don't order any windows in if this is a background
application.
* Source/NSEvent.m: fix missing commaa causing comple fail.
2009-10-17 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSApplication.m: centralise GSGuiBundle() routine

View file

@ -431,18 +431,6 @@ NSApplication *NSApp = nil;
return YES;
}
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
if ((place == NSWindowOut) && [NSApp isRunning])
{
NSLog (@"Argh - icon window ordered out");
}
else
{
[super orderWindow: place relativeTo: otherWin];
}
}
- (void) _initDefaults
{
[super _initDefaults];
@ -987,11 +975,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
}
[self setApplicationIconImage: image];
if (![defs boolForKey: @"GSSuppressAppIcon"])
{
[self _appIconInit];
}
[self _appIconInit];
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO)
@ -1240,6 +1224,12 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
_app_is_active = YES;
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSSuppressAppIcon"])
{
[_app_icon_window orderOut: self];
}
/* Make sure to calculate count after the notification, since
inactive status might be changed by a notifiee. */
count = [_inactive count];
@ -2355,6 +2345,12 @@ image.</p><p>See Also: -applicationIconImage</p>
_app_is_hidden = YES;
[[_app_icon_window contentView] setNeedsDisplay: YES];
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSSuppressAppIcon"])
{
[_app_icon_window orderFrontRegardless];
}
/*
* On hiding we also deactivate the application which will make the menus
* go away too.
@ -3627,7 +3623,13 @@ struct _DelegateWrapper
[_app_icon_window setContentView: iv];
RELEASE(iv);
[_app_icon_window orderFrontRegardless];
if (NO == [[NSUserDefaults standardUserDefaults]
boolForKey: @"GSSuppressAppIcon"])
{
/* The icon window is not suppressed ... display it.
*/
[_app_icon_window orderFrontRegardless];
}
return self;
}

View file

@ -691,7 +691,7 @@ static const char *eventTypes[] = {
default:
return [NSString stringWithFormat:
@"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %u,"
@" time = %f, window = %d"
@" time = %f, window = %d",
location_point.x, location_point.y,
modifier_flags, event_time, window_num];
break;

View file

@ -1647,6 +1647,12 @@ many times.
GSDisplayServer *srv = GSServerForWindow(self);
BOOL display = NO;
if (YES == [[NSUserDefaults standardUserDefaults]
boolForKey: @"GSBackgroundApp"])
{
return;
}
if (place == NSWindowOut)
{
if (_windowNum == 0)