summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
authorculler <culler>2019-07-15 20:15:28 (GMT)
committerculler <culler>2019-07-15 20:15:28 (GMT)
commitb3efbf32b48151ceb13d68b99f8f8fcfd43dd3d1 (patch)
tree6743f2516541dfd3300e6f6c0a18763e977b05b7 /macosx/tkMacOSXWindowEvent.c
parent287df04fb38894ffdeb0e91adcbcdf3300cbbd04 (diff)
downloadtk-b3efbf32b48151ceb13d68b99f8f8fcfd43dd3d1.zip
tk-b3efbf32b48151ceb13d68b99f8f8fcfd43dd3d1.tar.gz
tk-b3efbf32b48151ceb13d68b99f8f8fcfd43dd3d1.tar.bz2
Fix bug [5ddeca5927]: In Aqua, withdrawn windows can appear as zombies when activating a Tk application with Command-Tab
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-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