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:
parent
adca3cd253
commit
f6eb079d41
|
@ -1028,12 +1028,6 @@ void InitTextWindow() {
|
||||||
[TW setFrameAutosaveName:@"TextWindow"];
|
[TW setFrameAutosaveName:@"TextWindow"];
|
||||||
[TW setFloatingPanel:YES];
|
[TW setFloatingPanel:YES];
|
||||||
[TW setBecomesKeyOnlyIfNeeded: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];
|
NSScrollView *scrollView = [[NSScrollView alloc] init];
|
||||||
[TW setContentView:scrollView];
|
[TW setContentView:scrollView];
|
||||||
|
@ -1052,9 +1046,9 @@ void InitTextWindow() {
|
||||||
|
|
||||||
void ShowTextWindow(bool visible) {
|
void ShowTextWindow(bool visible) {
|
||||||
if(visible)
|
if(visible)
|
||||||
[GW addChildWindow:TW ordered:NSWindowAbove];
|
[TW orderFront:nil];
|
||||||
else
|
else
|
||||||
[TW orderOut:GW];
|
[TW close];
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetTextWindowSize(int *w, int *h) {
|
void GetTextWindowSize(int *w, int *h) {
|
||||||
|
@ -1145,8 +1139,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
|
||||||
- (void)applicationWillTerminate:(NSNotification *)aNotification;
|
- (void)applicationWillTerminate:(NSNotification *)aNotification;
|
||||||
- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
|
|
||||||
- (void)applicationWillResignActive:(NSNotification *)aNotification;
|
|
||||||
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
|
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
|
||||||
- (IBAction)preferences:(id)sender;
|
- (IBAction)preferences:(id)sender;
|
||||||
@end
|
@end
|
||||||
|
@ -1167,18 +1159,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
|
||||||
SolveSpace::SS.Exit();
|
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 {
|
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename {
|
||||||
return SolveSpace::SS.OpenFile([filename UTF8String]);
|
return SolveSpace::SS.OpenFile([filename UTF8String]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user