summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2018-12-04 22:41:37 (GMT)
committerculler <culler>2018-12-04 22:41:37 (GMT)
commit68112ff61624e85913f4b0c5b3bcde8bb5f08600 (patch)
tree829e17841b3c1fcbde7eef350d3b9a73506197c4
parent22f49d639009f2cbb687a3a956d5f00eb7050948 (diff)
downloadtk-68112ff61624e85913f4b0c5b3bcde8bb5f08600.zip
tk-68112ff61624e85913f4b0c5b3bcde8bb5f08600.tar.gz
tk-68112ff61624e85913f4b0c5b3bcde8bb5f08600.tar.bz2
Stop withdrawn windows from being displayed when the Wish app is reopened.
-rw-r--r--macosx/tkMacOSXHLEvents.c7
-rw-r--r--macosx/tkMacOSXWindowEvent.c14
2 files changed, 15 insertions, 6 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index 468e41c..9b874a5 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -93,12 +93,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent
{
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
- ProcessSerialNumber thePSN = {0, kCurrentProcess};
- SetFrontProcess(&thePSN);
-#else
- [[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
-#endif
+ [NSApp activateIgnoringOtherApps: YES];
if (_eventInterp && Tcl_FindCommand(_eventInterp,
"::tk::mac::ReopenApplication", NULL, 0)) {
int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ReopenApplication",
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 1f62d6e..30ef6a5 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -310,6 +310,20 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
#endif
}
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender
+ hasVisibleWindows:(BOOL)flag
+{
+ /*
+ * Allowing the default response means that withdrawn windows will get
+ * displayed on the screen with unresponsive title buttons. We don't
+ * really want that. Besides, we can write our own code to handle this
+ * with ::tk::mac::ReopenApplication. So we just say NO.
+ */
+
+ return NO;
+}
+
+
- (void) applicationShowHide: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS