summaryrefslogtreecommitdiffstats
path: root/mac
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2002-06-14 22:25:11 (GMT)
committerjenglish <jenglish@flightlab.com>2002-06-14 22:25:11 (GMT)
commit15879fe51346c8d78ce33c47a6c22755852add70 (patch)
treedb4f9b64945413c671514dd1b7f254700c3649cb /mac
parentad91e4c59c306ee78b3351f9c60fd3d39755f106 (diff)
downloadtk-15879fe51346c8d78ce33c47a6c22755852add70.zip
tk-15879fe51346c8d78ce33c47a6c22755852add70.tar.gz
tk-15879fe51346c8d78ce33c47a6c22755852add70.tar.bz2
TIP #47 "Modifying Tk to Allow Writing X Window managers"
(patch from Neil McKay). * Add CirculateRequest, Create, MapRequest, ResizeRequest, and ConfigureRequest event types; * Split TK_TOPLEVEL flag into TK_TOPLEVEL, TK_HAS_WRAPPER, TK_WIN_MANAGED, and TK_TOP_HIERARCHY.
Diffstat (limited to 'mac')
-rw-r--r--mac/tkMacSubwindows.c12
-rw-r--r--mac/tkMacWindowMgr.c6
-rw-r--r--mac/tkMacWm.c41
3 files changed, 40 insertions, 19 deletions
diff --git a/mac/tkMacSubwindows.c b/mac/tkMacSubwindows.c
index 23942f9..a60e901 100644
--- a/mac/tkMacSubwindows.c
+++ b/mac/tkMacSubwindows.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacSubwindows.c,v 1.6 2000/02/10 08:56:24 jingham Exp $
+ * RCS: @(#) $Id: tkMacSubwindows.c,v 1.7 2002/06/14 22:25:12 jenglish Exp $
*/
#include "tkInt.h"
@@ -724,14 +724,14 @@ TkMacUpdateClipRgn(
* This is not currently enforced, however.
*/
- if (!Tk_IsTopLevel(winPtr)) {
+ if (!Tk_TopWinHierarchy(winPtr)) {
TkMacUpdateClipRgn(winPtr->parentPtr);
SectRgn(rgn,
winPtr->parentPtr->privatePtr->aboveClipRgn, rgn);
win2Ptr = winPtr->nextPtr;
while (win2Ptr != NULL) {
- if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ if (Tk_TopWinHierarchy(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
win2Ptr = win2Ptr->nextPtr;
continue;
}
@@ -776,7 +776,7 @@ TkMacUpdateClipRgn(
win2Ptr = winPtr->childList;
while (win2Ptr != NULL) {
- if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ if (Tk_TopWinHierarchy(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
win2Ptr = win2Ptr->nextPtr;
continue;
}
@@ -1000,7 +1000,7 @@ TkMacInvalClipRgns(
*/
childPtr = winPtr->childList;
while (childPtr != NULL) {
- if (!Tk_IsTopLevel(childPtr) && Tk_IsMapped(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr) && Tk_IsMapped(childPtr)) {
TkMacInvalClipRgns(childPtr);
}
childPtr = childPtr->nextPtr;
@@ -1133,7 +1133,7 @@ UpdateOffsets(
childPtr = winPtr->childList;
while (childPtr != NULL) {
- if (!Tk_IsTopLevel(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr)) {
UpdateOffsets(childPtr, deltaX, deltaY);
}
childPtr = childPtr->nextPtr;
diff --git a/mac/tkMacWindowMgr.c b/mac/tkMacWindowMgr.c
index 894a7d0..abe0c35 100644
--- a/mac/tkMacWindowMgr.c
+++ b/mac/tkMacWindowMgr.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacWindowMgr.c,v 1.9 2001/11/23 02:06:32 das Exp $
+ * RCS: @(#) $Id: tkMacWindowMgr.c,v 1.10 2002/06/14 22:25:12 jenglish Exp $
*/
#include <Events.h>
@@ -426,7 +426,7 @@ GenerateUpdates(
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) {
+ if (!Tk_IsMapped(childPtr) || Tk_TopWinHierarchy(childPtr)) {
continue;
}
@@ -1546,7 +1546,7 @@ void
TkpSetCapture(
TkWindow *winPtr) /* Capture window, or NULL. */
{
- while ((winPtr != NULL) && !Tk_IsTopLevel(winPtr)) {
+ while ((winPtr != NULL) && !Tk_TopWinHierarchy(winPtr)) {
winPtr = winPtr->parentPtr;
}
gGrabWinPtr = (Tk_Window) winPtr;
diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c
index ae2cfc5..18170be 100644
--- a/mac/tkMacWm.c
+++ b/mac/tkMacWm.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacWm.c,v 1.17 2002/05/24 09:50:11 mdejong Exp $
+ * RCS: @(#) $Id: tkMacWm.c,v 1.18 2002/06/14 22:25:12 jenglish Exp $
*/
#include <Gestalt.h>
@@ -1870,10 +1870,13 @@ Tk_SetGrid(
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
if ((wmPtr->gridWin != NULL) && (wmPtr->gridWin != tkwin)) {
return;
@@ -1955,10 +1958,14 @@ Tk_UnsetGrid(
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
+
if (tkwin != wmPtr->gridWin) {
return;
}
@@ -2511,7 +2518,7 @@ Tk_GetRootCoords(
while (1) {
x += winPtr->changes.x + winPtr->changes.border_width;
y += winPtr->changes.y + winPtr->changes.border_width;
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
if (!(Tk_IsEmbedded(winPtr))) {
x += winPtr->wmInfoPtr->xInParent;
y += winPtr->wmInfoPtr->yInParent;
@@ -2561,6 +2568,9 @@ Tk_GetRootCoords(
}
}
}
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
+ break; /* Punt */
+ }
winPtr = winPtr->parentPtr;
}
*xPtr = x;
@@ -2668,7 +2678,7 @@ Tk_CoordsToWindow(
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
if (!Tk_IsMapped(childPtr) ||
- (childPtr->flags & TK_TOP_LEVEL)) {
+ (childPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
tmpx = x - childPtr->changes.x;
@@ -2762,7 +2772,7 @@ Tk_TopCoordsToWindow(
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
if (!Tk_IsMapped(childPtr) ||
- (childPtr->flags & TK_TOP_LEVEL)) {
+ (childPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
if (x < childPtr->changes.x || y < childPtr->changes.y) {
@@ -2895,10 +2905,13 @@ Tk_GetVRootGeometry(
* information for that window.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return; /* Punt */
+ }
/*
* Make sure that the geometry information is up-to-date, then copy
@@ -3322,10 +3335,14 @@ TkWmAddToColormapWindows(
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
if (topPtr->wmInfoPtr->flags & WM_COLORMAPS_EXPLICIT) {
return;
}
@@ -3412,7 +3429,7 @@ TkWmRemoveFromColormapWindows(
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -3430,6 +3447,10 @@ TkWmRemoveFromColormapWindows(
* it up.
*/
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
count = topPtr->wmInfoPtr->cmapCount;
oldPtr = topPtr->wmInfoPtr->cmapList;
for (i = 0; i < count; i++) {
@@ -4648,7 +4669,7 @@ TkWmFocusToplevel(
TkWindow *winPtr) /* Window that received a focus-related
* event. */
{
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
return NULL;
}
return winPtr;