diff --git a/ChangeLog b/ChangeLog index fc8bb7e85..c12d186cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Nov 4 1999 Richard Frith-Macdonald + + * Source/NSApplication.m: ([-runModalforWindow:]) make the window key + and order to front as specified in MacOS-X docs. + * Source/NSPanel.m: Remove redundant code from alert panels - + now done in NSApplication. + Tue Nov 2 1999 Richard Frith-Macdonald * Source/NSMatrix.m: Complete rewrite of code for handling cells diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 7fd27af5d..3d5e96d62 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -612,6 +612,10 @@ static NSCell* tileCell = nil; if ([theWindow isKindOfClass: [NSPanel class]]) [theWindow center]; + if ([self isActive]) + [theWindow makeKeyWindow]; + [theWindow orderFrontRegardless]; + theSession = NULL; code = NSRunContinuesResponse; diff --git a/Source/NSPanel.m b/Source/NSPanel.m index 7f945a51c..4de88c62e 100644 --- a/Source/NSPanel.m +++ b/Source/NSPanel.m @@ -434,11 +434,8 @@ static GSAlertPanel *gmodelAlertPanel = nil; - (int) runModal { - NSApplication *app; - - app = [NSApplication sharedApplication]; active = YES; - [app runModalForWindow: self]; + [NSApp runModalForWindow: self]; return result; } @@ -690,9 +687,6 @@ NSRunAlertPanel(NSString *title, standardAlertPanel = panel; } - if ([NSApp isActive]) - [panel makeKeyWindow]; - [panel orderFrontRegardless]; result = [panel runModal]; NSReleaseAlertPanel(panel); return result; @@ -714,9 +708,6 @@ NSRunCriticalAlertPanel(NSString *title, defaultButton, alternateButton, otherButton, ap); va_end (ap); - if ([NSApp isActive]) - [panel makeKeyWindow]; - [panel orderFrontRegardless]; result = [panel runModal]; NSReleaseAlertPanel(panel); return result; @@ -738,9 +729,6 @@ NSRunInformationalAlertPanel(NSString *title, defaultButton, alternateButton, otherButton, ap); va_end (ap); - if ([NSApp isActive]) - [panel makeKeyWindow]; - [panel orderFrontRegardless]; result = [panel runModal]; NSReleaseAlertPanel(panel); return result; @@ -803,9 +791,6 @@ NSRunLocalizedAlertPanel(NSString *table, standardAlertPanel = panel; } - if ([NSApp isActive]) - [panel makeKeyWindow]; - [panel orderFrontRegardless]; result = [panel runModal]; NSReleaseAlertPanel(panel); return result;