2004-10-15 07:33 Matt Rice <ratmice@yahoo.com>

* Source/NSApplication.m ([NSAppIconView -mouseDown:]): order front
        possibly obscured windows if not hidden.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20225 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2004-10-15 14:37:48 +00:00
parent 5271b53ebe
commit ff9620f5f4
2 changed files with 63 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2004-10-15 07:33 Matt Rice <ratmice@yahoo.com>
* Source/NSApplication.m ([NSAppIconView -mouseDown:]): order front
possibly obscured windows if not hidden.
2004-10-11 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSActionCell.m (-initWithCoder:):

View file

@ -424,6 +424,64 @@ static BOOL useWindowmakerIconBackground = NO;
{
if ([theEvent clickCount] >= 2)
{
/* If the app is not hidden we need to order front any visible and
possibly obscured windows. If we are active we need to order front
the key or main window again, otherwise unhide: will unhide and
activate us. Do this all in a way which will not change the stacking
order.
There are 3 possibilities:
1. app is active and has no obscured windows
2. app is active and has obscured windows
3. app is inactive.
I don't know of any way to tell 1 from 2 and do nothing.
This should ideally set aWin NSWindowBelow the key or main window
but with most windowmanagers. It doesn't seem to place the receiving
window immediately below like it should.
*/
if ([NSApp isHidden] == NO)
{
int i;
NSArray *windows = RETAIN([NSApp windows]);
for (i = 0; i < [windows count]; i++)
{
NSWindow *aWin = [windows objectAtIndex:i];
if ([aWin isVisible] == YES && [aWin isMiniaturized] == NO
&& aWin != [NSApp keyWindow] && aWin != [NSApp mainWindow]
&& aWin != [self window]
&& ([aWin styleMask] & NSMiniWindowMask) == 0)
{
[aWin orderFrontRegardless];
}
}
if ([NSApp isActive] == YES)
{
if ([NSApp keyWindow] != nil)
{
[[NSApp keyWindow] orderFront: self];
}
else if ([NSApp mainWindow] != nil)
{
[[NSApp mainWindow] makeKeyAndOrderFront: self];
}
else
{
/* We need give input focus to some window otherwise we'll
never get keyboard events. FIXME: doesn't work. */
NSWindow *menu_window= [[NSApp mainMenu] window];
NSDebugLLog(@"Focus", @"No key on activation - make menu key");
[GSServerForWindow(menu_window) setinputfocus:
[menu_window windowNumber]];
}
}
RELEASE(windows);
}
[NSApp unhide: self];
}
else