summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2019-07-16 18:38:07 (GMT)
committerculler <culler>2019-07-16 18:38:07 (GMT)
commitab02276febcf3661673c1c3ee4b17bce56f7276f (patch)
tree5234495a5a2b929595cbee5960792eadcdae2a91
parentda8e897eb8aea3620f7432c8e41493594a15b33f (diff)
parentb3efbf32b48151ceb13d68b99f8f8fcfd43dd3d1 (diff)
downloadtk-ab02276febcf3661673c1c3ee4b17bce56f7276f.zip
tk-ab02276febcf3661673c1c3ee4b17bce56f7276f.tar.gz
tk-ab02276febcf3661673c1c3ee4b17bce56f7276f.tar.bz2
Fix bug [5ddeca5927]: In Aqua, withdrawn windows can reappear as zombies
-rw-r--r--macosx/tkMacOSXWindowEvent.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 3703340..b8055e8 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -292,6 +292,22 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
[NSApp tkCheckPasteboard];
+
+ /*
+ * When the application is activated with Command-Tab it will create a
+ * zombie window for every Tk window which has been withdrawn. So iterate
+ * through the list of windows and order out any withdrawn window.
+ */
+
+ for (NSWindow *win in [NSApp windows]) {
+ TkWindow *winPtr = TkMacOSXGetTkWindow(win);
+ if (!winPtr || !winPtr->wmInfoPtr) {
+ continue;
+ }
+ if (winPtr->wmInfoPtr->hints.initial_state == WithdrawnState) {
+ [win orderOut:nil];
+ }
+ }
}
- (void) applicationDeactivate: (NSNotification *) notification