Index: NSApplication.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSApplication.m,v
retrieving revision 1.251
diff -u -r1.251 NSApplication.m
--- NSApplication.m	21 Sep 2003 02:27:50 -0000	1.251
+++ NSApplication.m	7 Oct 2003 04:45:42 -0000
@@ -1970,7 +1970,17 @@
   unsigned i, count;
 
   for (i = 0, count = [window_list count]; i < count; i++)
-    [[window_list objectAtIndex: i] miniaturize: sender];
+    {
+      NSWindow *win = [window_list objectAtIndex:i];
+      unsigned int styleMask = [win styleMask];
+
+      if ((!(styleMask & NSMiniaturizableWindowMask))
+	    || (styleMask & (NSIconWindowMask | NSMiniWindowMask))
+	    || (![win isVisible]))
+        continue;
+      
+      [win miniaturize: sender];
+    }
 }
 
 - (void) preventWindowOrdering
