--- CVS/core/gui/Source/NSPopUpButton.m	Tue Apr  2 14:19:42 2002
+++ CVS.build/gui/Source/NSPopUpButton.m	Sun Jan 19 18:42:06 2003
@@ -290,9 +290,15 @@
 - (BOOL) performKeyEquivalent: (NSEvent*)theEvent
 {
   NSMenu *m = [self menu];
+  BOOL   pr;
 
   if (m != nil)
-    return [m performKeyEquivalent: theEvent];
+    {
+      pr = [m performKeyEquivalent: theEvent];
+      [self setNeedsDisplay: YES];
+      return pr;
+    }
+    
   return NO;
 }
 
@@ -302,6 +308,8 @@
   NSWindow   *menuWindow = [mr window];
   NSEvent    *e;
   NSPoint    p;
+  int        lastSelectedItem = [mr highlightedItemIndex];
+  int        highlightedItemIndex;
 
   if ([self isEnabled] == NO)
     return;
@@ -325,6 +333,16 @@
 	       clickCount: [theEvent clickCount] 
 	       pressure: [theEvent pressure]];
   [menuWindow sendEvent: e];
+
+  // Selection remains unchanged if selected item is disabled
+  highlightedItemIndex = [mr highlightedItemIndex];
+  if (highlightedItemIndex >= 0)
+    {
+      if ([[self itemAtIndex: highlightedItemIndex] isEnabled] == NO)
+        {
+          [mr setHighlightedItemIndex: lastSelectedItem];
+        }
+    }
 
   // Dismiss the popUp
   [_cell dismissPopUp];
