diff options
author | jenglish <jenglish@flightlab.com> | 2002-06-14 22:25:11 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2002-06-14 22:25:11 (GMT) |
commit | 15879fe51346c8d78ce33c47a6c22755852add70 (patch) | |
tree | db4f9b64945413c671514dd1b7f254700c3649cb /win | |
parent | ad91e4c59c306ee78b3351f9c60fd3d39755f106 (diff) | |
download | tk-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 'win')
-rw-r--r-- | win/tkWinScrlbr.c | 4 | ||||
-rw-r--r-- | win/tkWinWindow.c | 8 | ||||
-rw-r--r-- | win/tkWinWm.c | 31 |
3 files changed, 29 insertions, 14 deletions
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 70fae0e..1eb3b47 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.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: tkWinScrlbr.c,v 1.7 2000/11/22 01:49:38 ericm Exp $ + * RCS: @(#) $Id: tkWinScrlbr.c,v 1.8 2002/06/14 22:25:12 jenglish Exp $ */ #include "tkWinInt.h" @@ -242,7 +242,7 @@ CreateProc(tkwin, parentWin, instanceData) for (winPtr = ((TkWindow*)tkwin)->nextPtr; winPtr != NULL; winPtr = winPtr->nextPtr) { - if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_LEVEL)) { + if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_HIERARCHY)) { TkWinSetWindowPos(scrollPtr->hwnd, Tk_GetHWND(winPtr->window), Below); break; diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index 175f54b..da871c7 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.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: tkWinWindow.c,v 1.9 2001/10/01 21:22:35 hobbs Exp $ + * RCS: @(#) $Id: tkWinWindow.c,v 1.10 2002/06/14 22:25:12 jenglish Exp $ */ #include "tkWinInt.h" @@ -371,13 +371,13 @@ XMapWindow(display, w) * its mapped children have just become visible. */ - if (!(winPtr->flags & TK_TOP_LEVEL)) { + if (!(winPtr->flags & TK_TOP_HIERARCHY)) { for (parentPtr = winPtr->parentPtr; ; parentPtr = parentPtr->parentPtr) { if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) { return; } - if (parentPtr->flags & TK_TOP_LEVEL) { + if (parentPtr->flags & TK_TOP_HIERARCHY) { break; } } @@ -478,7 +478,7 @@ XUnmapWindow(display, w) ShowWindow(Tk_GetHWND(w), SW_HIDE); winPtr->flags &= ~TK_MAPPED; - if (winPtr->flags & TK_TOP_LEVEL) { + if (winPtr->flags & TK_WIN_MANAGED) { event.type = UnmapNotify; event.xunmap.serial = display->request; event.xunmap.send_event = False; diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 1fd42a8..46390da 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.39 2002/06/12 19:02:50 mdejong Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.40 2002/06/14 22:25:12 jenglish Exp $ */ #include "tkWinInt.h" @@ -3308,7 +3308,7 @@ Tk_WmCmd(clientData, interp, argc, argv) if (masterPtr == NULL) { return TCL_ERROR; } - while (!(masterPtr->flags & TK_TOP_LEVEL)) { + while (!(masterPtr->flags & TK_TOP_HIERARCHY)) { /* * Ensure that the master window is actually a Tk toplevel. */ @@ -3476,10 +3476,13 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc) * 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; @@ -3560,10 +3563,14 @@ Tk_UnsetGrid(tkwin) * 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; } @@ -4592,10 +4599,14 @@ TkWmAddToColormapWindows(winPtr) 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; } @@ -4699,6 +4710,10 @@ TkWmRemoveFromColormapWindows(winPtr) return; } + if (topPtr->wmInfoPtr == NULL) { + return; + } + /* * Find the window and slide the following ones down to cover * it up. @@ -5201,7 +5216,7 @@ InvalidateSubTree(winPtr, colormap) * toplevel window. */ - if (!Tk_IsTopLevel(childPtr) && Tk_IsMapped(childPtr)) { + if (!Tk_TopWinHierarchy(childPtr) && Tk_IsMapped(childPtr)) { InvalidateSubTree(childPtr, colormap); } } @@ -5679,7 +5694,7 @@ TkWmFocusToplevel(winPtr) 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; @@ -5709,7 +5724,7 @@ TkpGetWrapperWindow( 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; |