OS X: revert "sort out window visibility and focus."

This reverts commit 1dba594949.

Turns out the old behavior was more appropriate for OS X.
This commit is contained in:
whitequark 2016-10-12 17:56:29 +00:00
parent adca3cd253
commit f6eb079d41

View File

@ -1028,12 +1028,6 @@ void InitTextWindow() {
[TW setFrameAutosaveName:@"TextWindow"];
[TW setFloatingPanel:YES];
[TW setBecomesKeyOnlyIfNeeded:YES];
[GW addChildWindow:TW ordered:NSWindowAbove];
// Without this, graphics window is also hidden when the text window is shown
// (and is its child window). We replicate the standard behavior manually, in
// the application delegate;
[TW setHidesOnDeactivate:NO];
NSScrollView *scrollView = [[NSScrollView alloc] init];
[TW setContentView:scrollView];
@ -1052,9 +1046,9 @@ void InitTextWindow() {
void ShowTextWindow(bool visible) {
if(visible)
[GW addChildWindow:TW ordered:NSWindowAbove];
[TW orderFront:nil];
else
[TW orderOut:GW];
[TW close];
}
void GetTextWindowSize(int *w, int *h) {
@ -1145,8 +1139,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
- (void)applicationWillTerminate:(NSNotification *)aNotification;
- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
- (void)applicationWillResignActive:(NSNotification *)aNotification;
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
- (IBAction)preferences:(id)sender;
@end
@ -1167,18 +1159,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
SolveSpace::SS.Exit();
}
- (void)applicationWillBecomeActive:(NSNotification *)aNotification {
if(SolveSpace::SS.GW.showTextWindow) {
[GW addChildWindow:TW ordered:NSWindowAbove];
}
}
- (void)applicationWillResignActive:(NSNotification *)aNotification {
[TW setAnimationBehavior:NSWindowAnimationBehaviorNone];
[TW orderOut:nil];
[TW setAnimationBehavior:NSWindowAnimationBehaviorDefault];
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename {
return SolveSpace::SS.OpenFile([filename UTF8String]);
}