summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXSubwindows.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2004-03-21 04:07:12 (GMT)
committerwolfsuit <wolfsuit>2004-03-21 04:07:12 (GMT)
commit6ceb932780ebbed7c4b93e1ec5bccf073e808bd9 (patch)
tree08221661d5894628d559bf730ab130a9363675fe /macosx/tkMacOSXSubwindows.c
parent5d5e80daa3a2538f68710f54dce61a4203a539d8 (diff)
downloadtk-6ceb932780ebbed7c4b93e1ec5bccf073e808bd9.zip
tk-6ceb932780ebbed7c4b93e1ec5bccf073e808bd9.tar.gz
tk-6ceb932780ebbed7c4b93e1ec5bccf073e808bd9.tar.bz2
XMoveWindow and XMoveResizeWindow need to propagate ConfigureNotify events
to the children of the moved or resized window.
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r--macosx/tkMacOSXSubwindows.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 43bb5a8..20b4506 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.4 2004/02/16 00:19:42 wolfsuit Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.5 2004/03/21 04:07:12 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
@@ -465,6 +509,7 @@ XMoveResizeWindow(
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);
}
}