Index: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEInvertingTextFieldCell.m
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEInvertingTextFieldCell.m	(revision 431)
+++ trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEInvertingTextFieldCell.m	(revision 432)
@@ -8,4 +8,5 @@
 
 #import "ICeCoffEEInvertingTextFieldCell.h"
+#import "ICeCoffEEMenuOutlineView.h"
 
 
@@ -19,5 +20,6 @@
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
 {
-    if ([self isHighlighted] && [[controlView window] firstResponder] == controlView && [[controlView window] isKeyWindow]) {
+    // XXX note cast to ICeCoffEEMenuOutlineView *; this is not general-purpose
+    if ([self isHighlighted] && [(ICeCoffEEMenuOutlineView *)controlView shouldUseActiveHighlight]) {
 	NSMutableAttributedString *astr = [[self attributedStringValue] mutableCopy];
 	unsigned location = 0, length = [astr length];
Index: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.h
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.h	(revision 431)
+++ trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.h	(revision 432)
@@ -11,6 +11,8 @@
 
 @interface ICeCoffEEMenuOutlineView : NSOutlineView {
-
+    NSWindow *mainWindow; // not retained
 }
 
+- (BOOL)shouldUseActiveHighlight;
+
 @end
Index: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.m
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.m	(revision 431)
+++ trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEMenuOutlineView.m	(revision 432)
@@ -18,4 +18,26 @@
 }
 
+// maintains main window (e.g., window to which sheet is attached) for use by shouldUseActiveHighlight
+- (void)viewDidMoveToWindow;
+{
+    mainWindow = [NSApp mainWindow];
+    [super viewDidMoveToWindow];
+}
+
+- (BOOL)shouldUseActiveHighlight;
+{
+    return NO;
+    // test cases: - XXX there should be a better way to do this
+    // see <http://lists.apple.com/archives/cocoa-dev/2008/Mar/msg00036.html>
+    // - About System Preferences...
+    // - focused character palette
+    // - Help menu search (Shortcut)
+    // - menu extras
+    NSWindow *keyWindow = [NSApp keyWindow], *thisWindow = [self window];
+    if (keyWindow != thisWindow && [keyWindow isKindOfClass: [NSPanel class]])
+	return NO; // exclude NSCarbonMenuWindow
+    return [thisWindow firstResponder] == self && [NSApp mainWindow] == mainWindow;
+}
+
 - (void)highlightSelectionInClipRect:(NSRect)clipRect;
 {
@@ -24,7 +46,9 @@
 
     HIThemeMenuItemDrawInfo drawInfo = {0, kThemeMenuItemHierBackground | kThemeMenuItemPopUpBackground, kThemeMenuSelected};
-    if ([[self window] firstResponder] != self || [NSApp keyWindow] != [self window]) {
-	NSLog(@"firstResponder %@ key %@ main %@ this %@", [[self window] firstResponder], [NSApp keyWindow], [NSApp mainWindow], [self window]);
+    NSLog(@"firstResponder %@ key %@ isKey %d main %@", [[self window] firstResponder], [NSApp keyWindow], [[self window] isKeyWindow], [NSApp mainWindow]);
+    if (![self shouldUseActiveHighlight]) {
+	instrumentObjcMessageSends(YES);
 	[super highlightSelectionInClipRect: clipRect];
+	instrumentObjcMessageSends(NO);
 	return;
     }
Index: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEServicePrefController.m
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEServicePrefController.m	(revision 431)
+++ trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEServicePrefController.m	(revision 432)
@@ -10,4 +10,5 @@
 #import "ICeCoffEEServices.h"
 #import "ICeCoffEEServicePrefController.h"
+#import "ICeCoffEEMenuOutlineView.h"
 #import "ICeCoffEENonHighlightingButtonCell.h"
 #import "ICeCoffEEInvertingTextFieldCell.h"
@@ -477,5 +478,5 @@
     
     if (![outlineView isRowSelected: [outlineView rowForItem: item]] ||
-	[[outlineView window] firstResponder] != outlineView || ![[outlineView window] isKeyWindow]) {
+	![(ICeCoffEEMenuOutlineView *)outlineView shouldUseActiveHighlight]) {
 	if (!isInverted)
 	    return;
