(-miniaturize:, -deminiaturize:): Check that the window can be miniaturized/deminiaturized before doing anything.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17788 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-10-07 12:34:10 +00:00
parent f42d8c1e23
commit c2cff94ce3
2 changed files with 23 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2003-10-07 14:32 Alexander Malmberg <alexander@malmberg.org>
* Source/NSWindow.m (-miniaturize:): Check that the window is
miniaturizable, visible, and not already miniaturized before
trying to miniaturize it.
(-deminiaturize:): Do nothing if the window isn't miniaturized.
(Based on patch from Matt Rice.)
2003-10-05 Adam Fedor <fedor@gnu.org>
* Source/DocMakefile: Remove dependencies file when cleaning.

View file

@ -2218,9 +2218,13 @@ resetCursorRectsForView(NSView *theView)
/**
Causes the window to deminiaturize. Normally you would not call this
method directly. A window is automatically deminiaturized by the
user via a mouse click event. */
user via a mouse click event. Does nothing it the window isn't
miniaturized. */
- (void) deminiaturize: sender
{
if (!_f.is_miniaturized)
return;
if (_counterpart != 0)
{
NSWindow *mini = GSWindowWithNumber(_counterpart);
@ -2244,10 +2248,19 @@ resetCursorRectsForView(NSView *theView)
/**
Causes the window to miniaturize, that is the window is removed from
the screen and it's counterpart (mini)window is displayed. */
the screen and it's counterpart (mini)window is displayed. Does
nothing if the window can't be miniaturized (eg. because it's already
miniaturized). */
- (void) miniaturize: (id)sender
{
GSDisplayServer *srv = GSServerForWindow(self);
if (_f.is_miniaturized
|| (!(_styleMask & NSMiniaturizableWindowMask))
|| (_styleMask & (NSIconWindowMask | NSMiniWindowMask))
|| (![self isVisible]))
return;
[nc postNotificationName: NSWindowWillMiniaturizeNotification
object: self];