diff options
author | das <das> | 2008-06-19 00:14:29 (GMT) |
---|---|---|
committer | das <das> | 2008-06-19 00:14:29 (GMT) |
commit | 87dea959c7c2e058cbee2c4bc523b64f38c3a9ba (patch) | |
tree | 84623cfaefe20607cb4df4967e68402c9bbb7867 /macosx/tkMacOSXSubwindows.c | |
parent | e3d2f9b265c5729320a7c8813e0eb4a4dd493244 (diff) | |
download | tk-87dea959c7c2e058cbee2c4bc523b64f38c3a9ba.zip tk-87dea959c7c2e058cbee2c4bc523b64f38c3a9ba.tar.gz tk-87dea959c7c2e058cbee2c4bc523b64f38c3a9ba.tar.bz2 |
* macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing
* macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by
only sending VisibilityNotify events once windows are mapped (rather
than when they are created).
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 0b46f7c..4e79d85 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -5,12 +5,12 @@ * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net> * * 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.2.2.22 2007/12/18 18:21:31 das Exp $ + * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2.2.23 2008/06/19 00:14:29 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -30,6 +30,7 @@ static void MoveResizeWindow(MacDrawable *macWin); static void GenerateConfigureNotify(TkWindow *winPtr, int includeWin); static void UpdateOffsets(TkWindow *winPtr, int deltaX, int deltaY); +static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr); /* @@ -252,6 +253,7 @@ XMapWindow( * We only need to send the MapNotify event * for toplevel windows. */ + event.xany.serial = display->request; event.xany.send_event = False; event.xany.display = display; @@ -269,6 +271,50 @@ XMapWindow( TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr); TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW); } + + /* + * Generate VisibilityNotify events for window and all mapped children. + */ + + event.xany.send_event = False; + event.xany.display = display; + event.xvisibility.type = VisibilityNotify; + event.xvisibility.state = VisibilityUnobscured; + NotifyVisibility(macWin->winPtr, &event); +} + +/* + *---------------------------------------------------------------------- + * + * NotifyVisibility -- + * + * Recursively called helper proc for XMapWindow(). + + * Results: + * None. + * + * Side effects: + * VisibilityNotify events are queued. + * + *---------------------------------------------------------------------- + */ + +static void +NotifyVisibility( + TkWindow *winPtr, + XEvent *eventPtr) +{ + if (winPtr->atts.event_mask & VisibilityChangeMask) { + eventPtr->xany.serial = LastKnownRequestProcessed(winPtr->display); + eventPtr->xvisibility.window = winPtr->window; + Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL); + } + for (winPtr = winPtr->childList; winPtr != NULL; + winPtr = winPtr->nextPtr) { + if (winPtr->flags & TK_MAPPED) { + NotifyVisibility(winPtr, eventPtr); + } + } } /* |