Window ordering fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18363 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2004-01-10 19:40:43 +00:00
parent 005d913203
commit 53bf81fa36
4 changed files with 75 additions and 10 deletions

View file

@ -1,3 +1,17 @@
2004-01-10 Adam Fedor <fedor@gnu.org>
* orderFront fixes
* Source/NSWindow.m (-orderFront:): Remove NSApp isActive
check.
(-orderFrontRegardless): Update for special case (otherWin=-1)
(-orderWindow:relativeTo:): Pass -1 for otherWin to backend
if we're the current app.
* Source/GSDisplayServer.m: Update documentations.
* Source/NSApplication.m (-changeWindowsItem:title:filename:): Revert
patch from 2003-10-20.
2004-01-10 16:36 Alexander Malmberg <alexander@malmberg.org>
* Source/NSScrollView.m (-drawRect:): Indentation fixes after last

View file

@ -559,7 +559,12 @@ GSCurrentServer(void)
}
/** Causes the window to be ordered onto or off the screen depending
on the value of op. The window is ordered relative to otherWin. */
on the value of op. The window is ordered relative to otherWin.
The window will never be ordered in front of the current key/main
window except in the special case where otherWin is negative (This
is a special feature that [NSWindow-orderWindow:relativeTo:] uses
to place the window correctly).
*/
- (void) orderwindow: (int) op : (int) otherWin : (int) win
{
[self subclassResponsibility: _cmd];

View file

@ -2381,7 +2381,7 @@ image.
i++;
}
item = [_windows_menu insertItemWithTitle: aString
action: @selector(deminiaturize:)
action: @selector(orderFront:)
keyEquivalent: @""
atIndex: i];
[item setTarget: aWindow];

View file

@ -1360,29 +1360,67 @@ many times.
[self becomeMainWindow];
}
/**
Orders the window to the back of its level. Equivalent to
-orderWindow: NSWindowBelow relativeTo: 0.
*/
- (void) orderBack: (id)sender
{
[self orderWindow: NSWindowBelow relativeTo: 0];
}
/**
If the application is active, orders the window to the front in its
level. If the application is not active, the window is ordered in as
far forward as possible in its level without being ordered in front
of the key or main window of the currently active app. The current key
and main window status is not changed. Equivalent to -orderWindow:
NSWindowAbove relativeTo: 0.
*/
- (void) orderFront: (id)sender
{
if ([NSApp isActive] == YES)
{
[self orderWindow: NSWindowAbove relativeTo: 0];
}
}
- (void) orderFrontRegardless
{
[self orderWindow: NSWindowAbove relativeTo: 0];
}
/**
Orders the window to the front in its level (even in front of the
key and main windows of the current app) regardless of whether the
app is current or not. This method should only be used in rare cases
where the app is cooperating with another app that is displaying
data for it. The current key and main window status is not changed.
*/
- (void) orderFrontRegardless
{
[self orderWindow: NSWindowAbove relativeTo: -1];
}
/**
Orders the window out from the screen. Equivalent to -orderWindow:
NSWindowOut relativeTo: 0.
*/
- (void) orderOut: (id)sender
{
[self orderWindow: NSWindowOut relativeTo: 0];
}
/**
<p>
If place is NSWindowOut, removes the window from the screen. If
place is NSWindowAbove, places the window directly above otherWin,
or directly above all windows in its level if otherWin is 0. If
place is NSWindowBelow, places the window directly below otherWin,
or directly below all windows in its level if otherWin is 0.
</p>
<p>
If place is NSWindowAbove or NSWindowBelow and the application is
hidden, the application is unhidden.
<p>
*/
/*
As a special undocumented case (for -orderFrontRegardless), if otherWin
is negative, then the backend should not try to keep the window below the
current key/main window
*/
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
GSDisplayServer *srv = GSServerForWindow(self);
@ -1434,6 +1472,14 @@ many times.
else if (place != NSWindowOut)
[_contentView displayIfNeeded];
/* The backend will keep us below the current key window unless we
force it not too */
if ((otherWin == 0
|| otherWin == [[NSApp keyWindow] windowNumber]
|| otherWin == [[NSApp mainWindow] windowNumber])
&& [NSApp isActive])
otherWin = -1;
[srv orderwindow: place : otherWin : _windowNum];
if (display)
[self display];