From cb120a21cfa13bf9d0de4a1f2e08823c01aee0ae Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Thu, 5 Jun 2008 23:13:40 +0200 Subject: [PATCH] Validate performClose: in MMWindow and MMFullscreenWindow Failing to validate would cause the "Close" menu item to be disabled in full-screen. --- src/MacVim/MMFullscreenWindow.m | 9 +++++++++ src/MacVim/MMWindow.m | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/MacVim/MMFullscreenWindow.m b/src/MacVim/MMFullscreenWindow.m index be0201e97b..717b8c26d6 100644 --- a/src/MacVim/MMFullscreenWindow.m +++ b/src/MacVim/MMFullscreenWindow.m @@ -298,6 +298,15 @@ static int numFullscreenWindows = 0; [super performClose:sender]; } +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + if ([item action] == @selector(vimMenuItemAction:) + || [item action] == @selector(performClose:)) + return [item tag]; + + return YES; +} + @end // MMFullscreenWindow diff --git a/src/MacVim/MMWindow.m b/src/MacVim/MMWindow.m index dae9087a56..96b65e2bb1 100644 --- a/src/MacVim/MMWindow.m +++ b/src/MacVim/MMWindow.m @@ -129,4 +129,13 @@ [super performClose:sender]; } +- (BOOL)validateMenuItem:(NSMenuItem *)item +{ + if ([item action] == @selector(vimMenuItemAction:) + || [item action] == @selector(performClose:)) + return [item tag]; + + return YES; +} + @end // MMWindow