summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2005-03-12 00:28:09 (GMT)
committerwolfsuit <wolfsuit>2005-03-12 00:28:09 (GMT)
commit6bdfe421432c25e3f3791dd7e50b1bfd71417da8 (patch)
treebccaa24f463d9c12da05e83b0f75c2974f629000 /macosx/tkMacOSXSubwindows.c
parentccd080b1015a8d3a491f01057242a650fd14c971 (diff)
downloadtk-6bdfe421432c25e3f3791dd7e50b1bfd71417da8.zip
tk-6bdfe421432c25e3f3791dd7e50b1bfd71417da8.tar.gz
tk-6bdfe421432c25e3f3791dd7e50b1bfd71417da8.tar.bz2
Fix for 1124237.
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r--macosx/tkMacOSXSubwindows.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index f1f4cb1..43bbd77 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.6 2004/11/11 01:24:32 das Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.7 2005/03/12 00:28:09 wolfsuit Exp $
*/
#include "tkInt.h"
@@ -68,6 +68,31 @@ XDestroyWindow(
if (Tk_IsTopLevel(macWin->winPtr)) {
+ WindowRef winRef;
+ /*
+ * We are relying on the Activate Mac OS event to pass the
+ * focus away from a window that is getting Destroyed to the
+ * Front non-floating window. BUT we don't get activate events
+ * when a floating window is destroyed - since the front non-floating
+ * window doesn't in fact get activated... So maybe we can check here
+ * and if we are destroying a floating window, we can pass the focus
+ * back to the front non-floating window...
+ */
+
+ if (macWin->grafPtr != NULL) {
+ TkWindow *focusPtr = TkGetFocusWin(macWin->winPtr);
+ if (focusPtr == NULL || (focusPtr->mainPtr->winPtr == macWin->winPtr)) {
+ winRef = GetWindowFromPort(macWin->grafPtr);
+ if (TkpIsWindowFloating (winRef)) {
+ Window window;
+
+ window = TkMacOSXGetXWindow(FrontNonFloatingWindow());
+ if (window != None) {
+ TkMacOSXGenerateFocusEvent(window, 1);
+ }
+ }
+ }
+ }
DisposeRgn(macWin->clipRgn);
DisposeRgn(macWin->aboveClipRgn);