summaryrefslogtreecommitdiffstats
path: root/mac/tkMacWm.c
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/tkMacWm.c
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/tkMacWm.c')
-rw-r--r--mac/tkMacWm.c41
1 files changed, 31 insertions, 10 deletions
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;