From d55ba4f2606219b20e83d36163db991d2345e326 Mon Sep 17 00:00:00 2001 From: wolfsuit Date: Sun, 21 Mar 2004 03:54:58 +0000 Subject: XMoveWindow and XMoveResizeWindow need to propagate configure notify events down to their children. --- ChangeLog | 8 +++++++ macosx/tkMacOSXSubwindows.c | 54 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ad99f3..ed9a335 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-03-20 Jim Ingham + + * macosx/tkMacOSXSubwindows.c (GenerateConfigureNotify): New + function. + (XMoveWindow): Generate configure notify events for child + widgets on move. + (XMoveResizeWindow): Ditto. + 2004-03-17 Jim Ingham * macosx/tkMacOSXHLEvents.c (ApplicationCarbonEventsHandler): New diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 1d881cf..3783017 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.2.2.1 2004/02/16 00:42:34 wolfsuit Exp $ + * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2.2.2 2004/03/21 03:54:59 wolfsuit Exp $ */ #include "tkInt.h" @@ -26,7 +26,13 @@ */ static RgnHandle tmpRgn = NULL; -static void UpdateOffsets _ANSI_ARGS_((TkWindow *winPtr, int deltaX, int deltaY)); +/* + * Prototypes for functions used only in this file. + */ + +static void GenerateConfigureNotify (TkWindow *winPtr, int includeWin); +static void UpdateOffsets _ANSI_ARGS_((TkWindow *winPtr, + int deltaX, int deltaY)); /* *---------------------------------------------------------------------- @@ -361,10 +367,48 @@ XResizeWindow( UpdateOffsets(macWin->winPtr, deltaX, deltaY); } } + /* *---------------------------------------------------------------------- * + * GenerateConfigureNotify -- + * + * Generates ConfigureNotify events for all the child widgets + * of the widget passed in the winPtr parameter. If includeWin + * is true, also generates ConfigureNotify event for the + * widget itself. + * + * Results: + * None. + * + * Side effects: + * ConfigureNotify events will be posted. + * + *---------------------------------------------------------------------- + */ + +static void +GenerateConfigureNotify (TkWindow *winPtr, int includeWin) +{ + TkWindow *childPtr; + + for (childPtr = winPtr->childList; childPtr != NULL; + childPtr = childPtr->nextPtr) { + if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) { + continue; + } + GenerateConfigureNotify(childPtr, 1); + } + if (includeWin) { + TkDoConfigureNotify(winPtr); + } +} + + +/* + *---------------------------------------------------------------------- + * * XMoveResizeWindow -- * * Move or resize a given X window. See X windows documentation @@ -461,10 +505,11 @@ XMoveResizeWindow( macWin->winPtr->changes.x; deltaY += macParent->yOff + parentBorderwidth + macWin->winPtr->changes.y; - - UpdateOffsets(macWin->winPtr, deltaX, deltaY); + + UpdateOffsets(macWin->winPtr, deltaX, deltaY); TkMacOSXWinBounds(macWin->winPtr, &bounds); InvalWindowRect(GetWindowFromPort(destPort),&bounds); + GenerateConfigureNotify(macWin->winPtr, 0); } } @@ -566,6 +611,7 @@ XMoveWindow( UpdateOffsets(macWin->winPtr, deltaX, deltaY); TkMacOSXWinBounds(macWin->winPtr, &bounds); InvalWindowRect(GetWindowFromPort(destPort),&bounds); + GenerateConfigureNotify(macWin->winPtr, 0); } } -- cgit v0.12