diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index a37b6a4f6..54e6d4587 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -1569,6 +1569,12 @@ withRepeatedImage: (NSImage*)image - (void) organizeMenu: (NSMenu *)menu isHorizontal: (BOOL)horizontal; +/** + * Used by the theme to override the proposed menu visibility. The default + * implementation simply returns the proposed visibility unmodified. + */ +- (BOOL) proposedVisibility: (BOOL)visible + forMenu: (NSMenu *) menu; @end @interface GSTheme (OpenSavePanels) diff --git a/Source/GSThemeMenu.m b/Source/GSThemeMenu.m index 023d5aaeb..0480b6dab 100644 --- a/Source/GSThemeMenu.m +++ b/Source/GSThemeMenu.m @@ -418,5 +418,11 @@ - (void) organizeMenu: (NSMenu *)menu [[menu menuRepresentation] update]; [menu sizeToFit]; } + +- (BOOL) proposedVisibility: (BOOL)visible + forMenu: (NSMenu *) menu +{ + return visible; +} @end diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 61915e42d..33e1e9c87 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -383,7 +383,8 @@ - (void) _rightMouseDisplay: (NSEvent*)theEvent - (BOOL) _isVisible { - return [_aWindow isVisible] || [_bWindow isVisible]; + BOOL isVisible = [_aWindow isVisible] || [_bWindow isVisible]; + return [[GSTheme theme] proposedVisibility: isVisible forMenu: self]; } - (BOOL) _isMain