Small change for bug #27309 and a helper function for GSTaskBar.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28974 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-11-08 16:12:04 +00:00
parent c7fee635d0
commit 2da5479a9e
3 changed files with 29 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2009-11-08 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (-finishLaunching): Only activate the
application if it isn't hidden.
* Source/Functions.m (NSConvertGlobalToWindowNumber,
NSConvertWindowNumberToGlobal): Add a slightly better implementation.
2009-11-05 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSDocumentController.m (+initialize): Don't ignore types

View file

@ -824,15 +824,27 @@ void NSSetFocusRingStyle(NSFocusRingPlacement placement)
void
NSConvertGlobalToWindowNumber(int globalNum, unsigned int *winNum)
{
// TODO
*winNum = (unsigned int)globalNum;
NSArray *windows = GSAllWindows();
unsigned count = [windows count];
unsigned i;
for (i = 0; i < count; i++)
{
NSWindow *win = [windows objectAtIndex: i];
if (((int)(intptr_t)[win windowRef]) == globalNum)
{
*winNum = [win windowNumber];
return;
}
}
*winNum = 0;
}
void
NSConvertWindowNumberToGlobal(int winNum, unsigned int *globalNum)
{
// TODO
*globalNum = (int)winNum;
*globalNum = (int)(intptr_t)[GSWindowWithNumber(winNum) windowRef];
}
void

View file

@ -852,7 +852,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
_hidden = [[NSMutableArray alloc] init];
_inactive = [[NSMutableArray alloc] init];
_unhide_on_activation = YES;
_app_is_hidden = YES;
_app_is_hidden = NO;
/* Ivar already automatically initialized to NO when the app is
created. */
//_app_is_active = NO;
@ -1095,7 +1095,11 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
addObserver: self selector: @selector(_workspaceNotification:)
name: GSUnhideAllApplicationsNotification object: nil];
[self activateIgnoringOtherApps: YES];
// Don't activate the application, when the delegate hid it
if (![self isHidden])
{
[self activateIgnoringOtherApps: YES];
}
/*
* Instantiate the NSDocumentController if we are a doc-based app