From 9b4383734335179f11c44239e4383907747ffad5 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 8 Nov 2007 14:25:04 +0000 Subject: * 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. --- macosx/tkMacOSXWindowEvent.c | 20 +++++++++++++++----- 1 file 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: -- cgit v0.12