Index: Source/NSPanel.m
===================================================================
--- Source/NSPanel.m	(revision 29310)
+++ Source/NSPanel.m	(working copy)
@@ -79,6 +79,11 @@
   return NO;
 }
 
+- (BOOL) canShowMenuBar
+{
+  return NO;
+}
+
 /*
  * If we receive an escape, close.
  */
Index: Source/GSWindowDecorationView.m
===================================================================
--- Source/GSWindowDecorationView.m	(revision 29310)
+++ Source/GSWindowDecorationView.m	(working copy)
@@ -32,6 +32,7 @@
 #include "AppKit/NSColor.h"
 #include "AppKit/NSMenuView.h"
 #include "AppKit/NSWindow.h"
+#include "AppKit/NSApplication.h"
 #include "GNUstepGUI/GSDisplayServer.h"
 #include "GNUstepGUI/GSTheme.h"
 
@@ -241,7 +242,7 @@
 				  menuHeightForWindow: 
 				[self window]];
       
-      menuView = [[_window menu] menuRepresentation];
+      menuView = [self findMenuView];
       [menuView setFrame: NSMakeRect(
               contentViewFrame.origin.x,
               NSMaxY(contentViewFrame) - menuBarHeight, 
@@ -486,6 +487,32 @@
   return nil;
 }
 
+/**
+  * Locate the menu view and returns it.
+  */
+- (NSMenuView*) findMenuView
+{
+  NSEnumerator	*e;
+  NSView	*v;
+
+  if (hasMenu == NO)
+    return nil;
+
+  e = [[self subviews] objectEnumerator];
+
+  while ((v = [e nextObject]) != nil)
+    {
+      if ([v isKindOfClass: [NSMenuView class]] == YES)
+	{
+          return (NSMenuView*)v;
+	}
+    }
+
+  [NSException raise:NSInternalInconsistencyException
+    format:@"Unable to find NSMenuView object although hasMenu == YES"];
+  return nil;
+}
+
 @end
 
 
Index: Source/NSMenu.m
===================================================================
--- Source/NSMenu.m	(revision 29310)
+++ Source/NSMenu.m	(working copy)
@@ -131,6 +131,7 @@
 - (void) _rightMouseDisplay: (NSEvent*)theEvent;
 - (void) _setGeometry;
 - (void) _updateUserDefaults: (id) notification;
+- (void) _setSuperAttachedMenuView: (id)superAttachedMenuView;
 
 @end
 
@@ -149,6 +150,11 @@
   return NO;
 }
 
+- (BOOL) canShowMenuBar
+{
+  return NO;
+}
+
 - (void) orderFrontRegardless
 {
   NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
@@ -541,6 +547,11 @@
     }
 }
 
+- (void) _setSuperAttachedMenuView:(id)superMenuView
+{
+  ASSIGN(_superAttachedMenuView, superMenuView);
+}
+
 @end
 
 
@@ -644,7 +655,7 @@
 
   /* Set up the notification to start the process of redisplaying
      the menus where the user left them the last time.  
-     
+    
      Use NSApplicationDidFinishLaunching, and not
      NSApplicationWillFinishLaunching, so that the programmer can set
      up menus in NSApplicationWillFinishLaunching.
@@ -1058,10 +1069,6 @@
 	          [self setMain: YES];
 		}
 	    }
-	  else if ([w menu] != self)
-	    {
-	      [w setMenu: self];
-	    }
 	}
     }
   if (_delegate)
@@ -1645,6 +1652,7 @@
         {
           [[supermenu menuRepresentation] setHighlightedItemIndex: -1];
           supermenu->_attachedMenu = nil;
+          [self _setSuperAttachedMenuView: nil];
         }
     }
   [_view update];
@@ -1721,6 +1729,11 @@
 
 - (void) display
 {
+  [self displayWithSuperview:[_superMenu menuRepresentation]];
+}
+
+- (void) displayWithSuperview:(NSMenuView*)superView
+{
   if (_menu.transient)
     {
       NSDebugLLog (@"NSMenu", 
@@ -1735,8 +1748,9 @@
   if (_superMenu && ![self isTornOff])
     {                 
       // query super menu for position
-      [_aWindow setFrameOrigin: [_superMenu locationForSubmenu: self]];
+      [_aWindow setFrameOrigin: [superView locationForSubmenu: self]];
       _superMenu->_attachedMenu = self;
+      [self _setSuperAttachedMenuView: superView];
     }
   else if ([_aWindow frame].origin.y <= 0 
     && _popUpButtonCell == nil)   // get geometry only if not set
@@ -1751,7 +1765,7 @@
   [_aWindow orderFrontRegardless];
 }
 
-- (void) displayTransient
+- (void) displayTransientWithSuperView:(id)superRep
 {
   NSPoint location;
   NSView *contentView;
@@ -1774,11 +1788,12 @@
    * Cache the old submenu if any and query the supermenu our position.
    * Otherwise, raise menu under the mouse.
    */
-  if (_superMenu != nil)
+  if (superRep != nil)
     {
       _oldAttachedMenu = _superMenu->_attachedMenu;
       _superMenu->_attachedMenu = self;
-      location = [_superMenu locationForSubmenu: self];
+      location = [superRep locationForSubmenu: self];
+      [self _setSuperAttachedMenuView: superRep];
     }
   else
     {
@@ -1804,6 +1819,11 @@
   [_bWindow orderFront: self];
 }
 
+- (void) displayTransient
+{
+  [self displayTransientWithSuperView:[_superMenu menuRepresentation]];
+}
+
 - (void) close
 {
   NSMenu *sub = [self attachedMenu];
@@ -1828,6 +1848,7 @@
   if (_superMenu && ![self isTornOff])
     {
       _superMenu->_attachedMenu = nil;
+      [self _setSuperAttachedMenuView: nil];
       [[_superMenu menuRepresentation] setHighlightedItemIndex: -1];
     }
 }
@@ -1855,8 +1876,9 @@
   if (_superMenu != nil)
     {
       _superMenu->_attachedMenu = _oldAttachedMenu;
-      [[_superMenu menuRepresentation] setHighlightedItemIndex:
+      [_superAttachedMenuView setHighlightedItemIndex:
 	[_superMenu indexOfItemWithSubmenu: _superMenu->_attachedMenu]];
+      [self _setSuperAttachedMenuView: nil];
     }
 
   [[self menuRepresentation] setHighlightedItemIndex: _oldHiglightedIndex];
@@ -1908,15 +1930,33 @@
           RELEASE(newRep);
           if (newStyle == NSWindows95InterfaceStyle)
             {
-              /* Put menu in the main window for microsoft style.
-               */
-              [[NSApp mainWindow] setMenu: self];
+             // Make all windows that can show the menu bar contain
+             // this menu.
+             NSEnumerator* windowEnum =
+               [[[NSApplication sharedApplication] windows]
+                objectEnumerator];
+             NSWindow* current = [windowEnum nextObject];
+             while (current != nil)
+              {
+                if ([current canShowMenuBar] == YES)
+                  [current setMenu:self];
+                current = [windowEnum nextObject];
+              }
             }
           else if ([[NSApp mainWindow] menu] == self)
             {
-              /* Remove the menu from the main window.
-               */
-              [[NSApp mainWindow] setMenu: nil];
+               // Make all windows that can show the menu bar remove
+               // this menu.
+               NSEnumerator* windowEnum =
+                 [[[NSApplication sharedApplication] windows]
+                  objectEnumerator];
+               NSWindow* current = [windowEnum nextObject];
+               while (current != nil)
+                {
+                  if ([current canShowMenuBar] == YES)
+                    [current setMenu:nil];
+                  current = [windowEnum nextObject];
+                }
             }
         }
       
@@ -2037,6 +2077,11 @@
     }
 }
 
+- (id) superAttachedMenuView
+{
+  return _superAttachedMenuView;
+}
+
 - (BOOL)_ownedByPopUp
 {
   return _popUpButtonCell != nil;
Index: Source/NSWindow.m
===================================================================
--- Source/NSWindow.m	(revision 29310)
+++ Source/NSWindow.m	(working copy)
@@ -364,6 +364,11 @@
   return NO;
 }
 
+- (BOOL) canShowMenuBar
+{
+  return NO;
+}
+
 - (void) _initDefaults
 {
   [super _initDefaults];
@@ -1701,6 +1706,14 @@
           [self _initBackendWindow];
           display = YES;
         }
+      // Insert the main menu into the window
+      // if this window can show the menu bar.
+      if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil)==NSWindows95InterfaceStyle && 
+          [self canShowMenuBar] && 
+          [self menu] == nil)
+        [self setMenu:[[NSApplication sharedApplication] mainMenu]];
+      else if ([self canShowMenuBar] == NO && [self menu] != nil)
+        [self setMenu:nil];
     }
 
   // Draw content before backend window ordering
@@ -1801,12 +1814,6 @@
         {
           [_wv setInputState: GSTitleBarNormal];
         }
-      if ([self menu] == [NSApp mainMenu])
-	{
-	  /* This window contains the main menu ... remove it.
-	   */
-	  [self setMenu: nil];
-	}
       [nc postNotificationName: NSWindowDidResignMainNotification object: self];
     }
 }
@@ -5253,6 +5260,18 @@
 
 @end
 
+@implementation NSWindow (GNUstepExtra)
+
+- (BOOL) canShowMenuBar
+{
+  if ((NSResizableWindowMask | NSTitledWindowMask) & _styleMask)
+    return YES;
+  else
+    return NO;
+}
+
+@end
+
 @implementation NSWindow (Toolbar)
 
 - (void) runToolbarCustomizationPalette: (id)sender
Index: Source/GSThemeMenu.m
===================================================================
--- Source/GSThemeMenu.m	(revision 29310)
+++ Source/GSThemeMenu.m	(working copy)
@@ -56,26 +56,16 @@
     {
       NSMenuView *menuView;
       
-      /* Restore the old representation to its original menu after
-       * removing it from the window.  If we didn't do this, the menu
-       * representation would be left without a partent view or
-       * window to draw in.
-       */
-      menuView = [wv removeMenuView];
-      [[window menu] setMenuRepresentation: menuView];
-      [menuView sizeToFit];
-      
-      /* Set the new menu, and transfer the new menu representation
-       * to the window decoration view.
-       */
+      [wv removeMenuView];
       menuView = [menu menuRepresentation];
       if (menuView != nil)
-	{
-	  [menu close];
-	  [menuView setHorizontal: YES];
-	  [menuView sizeToFit];
-	  [wv addMenuView: menuView];
-	}
+        {
+          menuView = [[NSMenuView alloc] initWithFrame: NSZeroRect];
+          [menuView setMenu: menu];
+          [menuView setHorizontal: YES];
+          [menuView sizeToFit];
+          [wv addMenuView: menuView];
+        }
     }
 }
 
Index: Source/NSMenuView.m
===================================================================
--- Source/NSMenuView.m	(revision 29310)
+++ Source/NSMenuView.m	(working copy)
@@ -236,7 +236,7 @@
       [theCenter removeObserver: self  name: nil  object: _attachedMenu];
     }
 
-  /* menu is retaining us, so we should not be retaining menu.  */
+  /* menu or window view is retaining us, so we should not be retaining menu.  */
   _attachedMenu = menu;
   _items_link = [_attachedMenu itemArray];
 
@@ -552,16 +552,19 @@
   
   attachableMenu = [[_items_link objectAtIndex: index] submenu];
 
-  if ([attachableMenu isTornOff] || [_attachedMenu isTransient])
+  if ([attachableMenu isTornOff] || [_attachedMenu isTransient]
+    || (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == NSWindows95InterfaceStyle &&
+        [_attachedMenu supermenu] == nil)
+    ) 
     {
       NSDebugLLog (@"NSMenu",  @"Will open transient: %@", attachableMenu);
-      [attachableMenu displayTransient];
+      [attachableMenu displayTransientWithSuperView:self];
       [[attachableMenu menuRepresentation] setHighlightedItemIndex: -1]; 
     }
   else
     {
       NSDebugLLog (@"NSMenu",  @"Will open normal: %@", attachableMenu);
-      [attachableMenu display];
+      [attachableMenu displayWithSuperview:self];
     }
 }
 
@@ -977,7 +980,7 @@
   if (_needsSizing)
     [self sizeToFit];
 
-  if (aSubmenu)
+  if (aSubmenu != nil)
     submenuFrame = [[[aSubmenu menuRepresentation] window] frame];
   else
     submenuFrame = NSZeroRect;
@@ -1468,6 +1471,10 @@
               NSWindow *windowUnderMouse;
               NSMenu *candidateMenu;
 
+              NSMenuView *candidateMenuView;
+              NSRect candidateMenuViewFrame;
+              NSPoint candidateMouseLocation;
+
               subMenusNeedRemoving = NO;
 
               locationInScreenCoordinates
@@ -1481,23 +1488,31 @@
                *          We are a non-transient attached menu
                *          We are a root: isTornOff of AppMenu
                */
-              candidateMenu = [_attachedMenu supermenu];
-              while (candidateMenu  
-                && !NSMouseInRect (locationInScreenCoordinates, 
-                  [[candidateMenu window] frame], NO) // not found yet
-                && (! ([candidateMenu isTornOff] 
-                  && ![candidateMenu isTransient]))  // no root of display tree
-                && [candidateMenu isAttached]) // has displayed parent
+              candidateMenu = _attachedMenu;
+              do
                 {
-                  candidateMenu = [candidateMenu supermenu];
+                  candidateMenuView = [candidateMenu superAttachedMenuView];
+                  candidateMenu = [candidateMenuView menu];
+                  candidateMenuViewFrame = [candidateMenuView convertRect:[candidateMenuView bounds] toView:nil];
+                  candidateMouseLocation = [[candidateMenuView window] 
+                    convertScreenToBase: locationInScreenCoordinates];
                 }
-
-              if (candidateMenu != nil
-                && NSMouseInRect (locationInScreenCoordinates,
-                  [[candidateMenu window] frame], NO))
+              while (candidateMenuView
+                  && !NSMouseInRect(candidateMouseLocation,
+                    candidateMenuViewFrame,
+                    NO) // not found yet
+                  && (! ([candidateMenu isTornOff]
+                      && ![candidateMenu isTransient])) // not root of display tree
+                  && [candidateMenu isAttached]); // has display parent
+              
+              if (candidateMenuView != nil
+                && NSMouseInRect (candidateMouseLocation,
+                  candidateMenuViewFrame, NO))
                 {
                   BOOL        candidateMenuResult;
 
+                  candidateMenu = [candidateMenuView menu];
+
                   // The call to fetch attachedMenu is not needed. But putting
                   // it here avoids flicker when we go back to an ancestor 
                   // menu and the attached menu is already correct.
@@ -1510,7 +1525,7 @@
                   [[[candidateMenu attachedMenu] menuRepresentation]
                     setHighlightedItemIndex: -1];
                   
-                  candidateMenuResult = [[candidateMenu menuRepresentation]
+                  candidateMenuResult = [candidateMenuView
                            trackWithEvent: original];
                   return candidateMenuResult;
                 }
@@ -1600,18 +1615,21 @@
   // remove transient menus. --------------------------------------------
   {
     NSMenu *currentMenu = _attachedMenu;
+    NSMenuView *currentMenuView;
     
     while (currentMenu && ![currentMenu isTransient])
       {
 	currentMenu = [currentMenu attachedMenu];
       }
     
-    while ([currentMenu isTransient] && [currentMenu supermenu])
+    currentMenuView = [currentMenu menuRepresentation];
+    while ([currentMenu isTransient] && [currentMenu superAttachedMenuView])
       {
-	currentMenu = [currentMenu supermenu];
+        currentMenuView = [currentMenu superAttachedMenuView];
+        currentMenu = [currentMenuView menu];
       }
     
-    [[currentMenu menuRepresentation] detachSubmenu];
+    [currentMenuView detachSubmenu];
     
     if ([currentMenu isTransient])
       {
Index: Source/NSToolbarFrameworkPrivate.h
===================================================================
--- Source/NSToolbarFrameworkPrivate.h	(revision 29310)
+++ Source/NSToolbarFrameworkPrivate.h	(working copy)
@@ -122,6 +122,7 @@
 @interface GSWindowDecorationView (Menu)
 - (void) addMenuView: (NSMenuView*)menuView;
 - (NSMenuView*) removeMenuView;
+- (NSMenuView*) findMenuView;
 @end
 
 #endif // _NSToolbarFrameworkPrivate_h_INCLUDE
Index: Headers/AppKit/NSMenu.h
===================================================================
--- Headers/AppKit/NSMenu.h	(revision 29310)
+++ Headers/AppKit/NSMenu.h	(working copy)
@@ -353,6 +353,7 @@
 @private
   NSWindow *_aWindow;
   NSWindow *_bWindow;
+  NSView<NSMenuView>* _superAttachedMenuView;
   NSMenu *_oldAttachedMenu;
   int     _oldHiglightedIndex;
 }
@@ -703,10 +704,21 @@
  */
 - (void) display;
 
+- (void) displayWithSuperview:(id)menuView;
+
 /** Display the transient version of the menu.  
  */
 - (void) displayTransient;
 
+- (void) displayTransientWithSuperView:(id)menuView;
+
+/** Returns the menu view instance to which this
+  * menu is attached, or nil if this
+  * menu has not been attached to a
+  * super view.
+  */
+- (id) superAttachedMenuView;
+
 - (BOOL) isPartlyOffScreen; 
 
 /** Returns YES if there is a transient version
Index: Headers/AppKit/NSWindow.h
===================================================================
--- Headers/AppKit/NSWindow.h	(revision 29310)
+++ Headers/AppKit/NSWindow.h	(working copy)
@@ -758,6 +758,9 @@
 - (void) setToolbar: (NSToolbar*)toolbar;
 @end
 
+@interface NSWindow (GNUstepExtra)
+- (BOOL) canShowMenuBar;
+@end
 #if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
 /*
  * GNUstep backend methods
