summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r--macosx/tkMacOSXWindowEvent.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 78e428f..b4ca8dd 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.29 2007/10/12 03:14:48 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.30 2007/11/08 14:25:04 das Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -232,7 +232,7 @@ TkMacOSXProcessWindowEvent(
case kEventWindowActivated:
case kEventWindowDeactivated:
case kEventWindowUpdate:
- case kEventWindowExpanded:
+ case kEventWindowExpanding:
case kEventWindowBoundsChanged:
case kEventWindowDragStarted:
case kEventWindowDragCompleted:
@@ -275,10 +275,20 @@ TkMacOSXProcessWindowEvent(
statusPtr->stopProcessing = 1;
}
break;
- case kEventWindowExpanded:
+ case kEventWindowExpanding:
if (winPtr) {
- TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
- ZoomState : NormalState);
+ winPtr->wmInfoPtr->hints.initial_state =
+ TkMacOSXIsWindowZoomed(winPtr) ? ZoomState :
+ NormalState;
+ Tk_MapWindow((Tk_Window) winPtr);
+ /*
+ * Need to process all Tk events generated by Tk_MapWindow()
+ * before returning to ensure all children are mapped, as
+ * otherwise the Activate event that follows Expanding would
+ * not be processed by any unmapped children.
+ */
+ while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {};
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {};
}
break;
case kEventWindowBoundsChanged: