Invalidate Quit also when running native file chooser.

This commit is contained in:
ManoloFLTK 2019-03-23 14:38:20 +01:00
parent f89593d0de
commit e8d7eb1e46

View File

@ -3890,7 +3890,8 @@ int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int
@end @end
@implementation FLaboutItemTarget @implementation FLaboutItemTarget
- (BOOL)validateMenuItem:(NSMenuItem *)item - (BOOL)validateMenuItem:(NSMenuItem *)item
{ // invalidate the Quit item of the application menu when running modal { // invalidate the Quit item of the application menu when running modal or when in native file chooser
if ([[NSApp keyWindow] isKindOfClass:[NSSavePanel class]]) return NO;
if (!Fl::modal() || [item action] != @selector(terminate:)) return YES; if (!Fl::modal() || [item action] != @selector(terminate:)) return YES;
return NO; return NO;
} }