summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2007-11-08 14:25:04 (GMT)
committerdas <das>2007-11-08 14:25:04 (GMT)
commit9b4383734335179f11c44239e4383907747ffad5 (patch)
treed34848a573286f48256adeaa199cff4b3a21f9c6
parentc08f2e1d5f2562b82353e92ed9c8e4243de8664c (diff)
downloadtk-9b4383734335179f11c44239e4383907747ffad5.zip
tk-9b4383734335179f11c44239e4383907747ffad5.tar.gz
tk-9b4383734335179f11c44239e4383907747ffad5.tar.bz2
* macosx/tkMacOSXWindowEvent.c: handle kEventWindowExpanding carbon
* macosx/tkMacOSXCarbonEvents.c: event instead of kEventWindowExpanded to ensure activate event arrives after window is remapped, also need to process all Tk events generated by remapping in the event handler to ensure children are remapped before activate event is processed.
-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: