diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-09 09:55:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-09 09:55:56 (GMT) |
commit | 9c82b94f7f8be2ebc6cf88f55d08d6e087cff5a5 (patch) | |
tree | 976f58bbb47262acff6f1ff2a3d3872665a22cc6 /win/tkWinWm.c | |
parent | 19d012df44dac9aaf5faa9b3beca5a6396ea21a8 (diff) | |
download | tk-9c82b94f7f8be2ebc6cf88f55d08d6e087cff5a5.zip tk-9c82b94f7f8be2ebc6cf88f55d08d6e087cff5a5.tar.gz tk-9c82b94f7f8be2ebc6cf88f55d08d6e087cff5a5.tar.bz2 |
TIP #581: More progress
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r-- | win/tkWinWm.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f7ba611..923a58f 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -177,7 +177,7 @@ typedef struct TkWmInfo { * (corresponds to hints.window_group). * Malloc-ed. Note: this field doesn't get * updated if leader is destroyed. */ - TkWindow *masterPtr; /* Master window for TRANSIENT_FOR property, + TkWindow *containerPtr; /* Container window for TRANSIENT_FOR property, * or NULL. */ Tk_Window icon; /* Window to use as icon for this window, or * NULL. */ @@ -315,7 +315,7 @@ typedef struct TkWmInfo { * window (controlled by "wm resizable" command). * WM_WITHDRAWN - Non-zero means that this window has explicitly * been withdrawn. If it's a transient, it should - * not mirror state changes in the master. + * not mirror state changes in the container. * WM_FULLSCREEN - Non-zero means that this window has been placed * in the full screen mode. It should be mapped at * 0,0 and be the width and height of the screen. @@ -2054,7 +2054,7 @@ UpdateWrapper( */ parentHWND = GetDesktopWindow(); - if (wmPtr->masterPtr) { + if (wmPtr->containerPtr) { wmPtr->style |= WS_CHILD; } else { wmPtr->style |= WS_POPUP; @@ -2062,10 +2062,10 @@ UpdateWrapper( } else if (wmPtr->flags & WM_FULLSCREEN) { wmPtr->style = WM_FULLSCREEN_STYLE; wmPtr->exStyle = EX_FULLSCREEN_STYLE; - } else if (wmPtr->masterPtr) { + } else if (wmPtr->containerPtr) { wmPtr->style = WM_TRANSIENT_STYLE; wmPtr->exStyle = EX_TRANSIENT_STYLE; - parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->masterPtr)); + parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->containerPtr)); if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) && (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) { wmPtr->style |= WS_THICKFRAME; @@ -2204,7 +2204,7 @@ UpdateWrapper( if (wmPtr->numTransients > 0) { /* * Unset the current wrapper as the parent for all transient - * children for whom this is the master + * children for whom this is the container */ WmInfo *wmPtr2; @@ -2213,7 +2213,7 @@ UpdateWrapper( state = 0; for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr + if (wmPtr2->containerPtr == winPtr && !(wmPtr2->flags & WM_NEVER_MAPPED)) { childStateInfo[state++] = wmPtr2->hints.initial_state; SetParent(TkWinGetHWND(wmPtr2->winPtr->window), NULL); @@ -2292,7 +2292,7 @@ UpdateWrapper( if (childStateInfo) { if (wmPtr->numTransients > 0) { /* - * Reset all transient children for whom this is the master. + * Reset all transient children for whom this is the container. */ WmInfo *wmPtr2; @@ -2300,7 +2300,7 @@ UpdateWrapper( state = 0; for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr + if (wmPtr2->containerPtr == winPtr && !(wmPtr2->flags & WM_NEVER_MAPPED)) { UpdateWrapper(wmPtr2->winPtr); TkpWmSetState(wmPtr2->winPtr, childStateInfo[state++]); @@ -2365,10 +2365,10 @@ TkWmMapWindow( if (wmPtr->flags & WM_NEVER_MAPPED) { /* - * Don't map a transient if the master is not mapped. + * Don't map a transient if the container is not mapped. */ - if (wmPtr->masterPtr != NULL && !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->containerPtr != NULL && !Tk_IsMapped(wmPtr->containerPtr)) { wmPtr->hints.initial_state = WithdrawnState; return; } @@ -2610,17 +2610,17 @@ TkWmDeadWindow( } /* - * Reset all transient windows whose master is the dead window. + * Reset all transient windows whose container is the dead window. */ for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL; wmPtr2 = wmPtr2->nextPtr) { - if (wmPtr2->masterPtr == winPtr) { + if (wmPtr2->containerPtr == winPtr) { wmPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr, + Tk_DeleteEventHandler((Tk_Window) wmPtr2->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, wmPtr2->winPtr); - wmPtr2->masterPtr = NULL; + wmPtr2->containerPtr = NULL; if ((wmPtr2->wrapper != NULL) && !(wmPtr2->flags & (WM_NEVER_MAPPED))) { UpdateWrapper(wmPtr2->winPtr); @@ -2670,20 +2670,20 @@ TkWmDeadWindow( if (wmPtr->flags & WM_UPDATE_PENDING) { Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } - if (wmPtr->masterPtr != NULL) { - wmPtr2 = wmPtr->masterPtr->wmInfoPtr; + if (wmPtr->containerPtr != NULL) { + wmPtr2 = wmPtr->containerPtr->wmInfoPtr; /* - * If we had a master, tell them that we aren't tied to them anymore. + * If we had a container, tell them that we aren't tied to them anymore. */ if (wmPtr2 != NULL) { wmPtr2->numTransients--; } - Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, + Tk_DeleteEventHandler((Tk_Window) wmPtr->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); - wmPtr->masterPtr = NULL; + wmPtr->containerPtr = NULL; } if (wmPtr->crefObj != NULL) { Tcl_DecrRefCount(wmPtr->crefObj); @@ -4154,7 +4154,7 @@ WmIconifyCmd( NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { + if (wmPtr->containerPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); @@ -5403,7 +5403,7 @@ WmStateCmd( "OVERRIDE_REDIRECT", NULL); return TCL_ERROR; } - if (wmPtr->masterPtr != NULL) { + if (wmPtr->containerPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); @@ -5549,7 +5549,7 @@ WmTransientCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; - TkWindow *masterPtr = wmPtr->masterPtr, **masterPtrPtr = &masterPtr, *w; + TkWindow *containerPtr = wmPtr->containerPtr, **containerPtrPtr = &containerPtr, *w; WmInfo *wmPtr2; if ((objc != 3) && (objc != 4)) { @@ -5557,38 +5557,38 @@ WmTransientCmd( return TCL_ERROR; } if (objc == 3) { - if (masterPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr)); + if (containerPtr != NULL) { + Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) containerPtr)); } return TCL_OK; } if (Tcl_GetString(objv[3])[0] == '\0') { - if (masterPtr != NULL) { + if (containerPtr != NULL) { /* - * If we had a master, tell them that we aren't tied to them + * If we had a container, tell them that we aren't tied to them * anymore. */ - masterPtr->wmInfoPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) masterPtr, + containerPtr->wmInfoPtr->numTransients--; + Tk_DeleteEventHandler((Tk_Window) containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); } - wmPtr->masterPtr = NULL; + wmPtr->containerPtr = NULL; } else { if (TkGetWindowFromObj(interp, tkwin, objv[3], - (Tk_Window *) masterPtrPtr) != TCL_OK) { + (Tk_Window *) containerPtrPtr) != TCL_OK) { return TCL_ERROR; } - while (!Tk_TopWinHierarchy(masterPtr)) { + while (!Tk_TopWinHierarchy(containerPtr)) { /* - * Ensure that the master window is actually a Tk toplevel. + * Ensure that the container window is actually a Tk toplevel. */ - masterPtr = masterPtr->parentPtr; + containerPtr = containerPtr->parentPtr; } - Tk_MakeWindowExist((Tk_Window) masterPtr); + Tk_MakeWindowExist((Tk_Window) containerPtr); if (wmPtr->iconFor != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -5598,7 +5598,7 @@ WmTransientCmd( return TCL_ERROR; } - wmPtr2 = masterPtr->wmInfoPtr; + wmPtr2 = containerPtr->wmInfoPtr; if (wmPtr2->iconFor != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -5607,42 +5607,42 @@ WmTransientCmd( Tcl_SetErrorCode(interp, "TK", "WM", "TRANSIENT", "ICON", NULL); return TCL_ERROR; } - for (w = masterPtr; w != NULL && w->wmInfoPtr != NULL; - w = (TkWindow *)w->wmInfoPtr->masterPtr) { + for (w = containerPtr; w != NULL && w->wmInfoPtr != NULL; + w = (TkWindow *)w->wmInfoPtr->containerPtr) { if (w == winPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "setting \"%s\" as master creates a transient/master cycle", - Tk_PathName(masterPtr))); + Tk_PathName(containerPtr))); Tcl_SetErrorCode(interp, "TK", "WM", "TRANSIENT", "SELF", NULL); return TCL_ERROR; } } - if (masterPtr != wmPtr->masterPtr) { + if (containerPtr != wmPtr->containerPtr) { /* - * Remove old master map/unmap binding before setting the new - * master. The event handler will ensure that transient states - * reflect the state of the master. + * Remove old container map/unmap binding before setting the new + * container. The event handler will ensure that transient states + * reflect the state of the container. */ - if (wmPtr->masterPtr != NULL) { - wmPtr->masterPtr->wmInfoPtr->numTransients--; - Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, + if (wmPtr->containerPtr != NULL) { + wmPtr->containerPtr->wmInfoPtr->numTransients--; + Tk_DeleteEventHandler((Tk_Window) wmPtr->containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); } - masterPtr->wmInfoPtr->numTransients++; - Tk_CreateEventHandler((Tk_Window) masterPtr, + containerPtr->wmInfoPtr->numTransients++; + Tk_CreateEventHandler((Tk_Window) containerPtr, VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, winPtr); - wmPtr->masterPtr = masterPtr; + wmPtr->containerPtr = containerPtr; } } if (!((wmPtr->flags & WM_NEVER_MAPPED) && !(winPtr->flags & TK_EMBEDDED))) { - if (wmPtr->masterPtr != NULL - && !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->containerPtr != NULL + && !Tk_IsMapped(wmPtr->containerPtr)) { TkpWmSetState(winPtr, WithdrawnState); } else { UpdateWrapper(winPtr); @@ -5728,9 +5728,9 @@ WmWaitVisibilityOrMapProc( XEvent *eventPtr) /* Information about event. */ { TkWindow *winPtr = (TkWindow *)clientData; - TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr; + TkWindow *containerPtr = winPtr->wmInfoPtr->containerPtr; - if (masterPtr == NULL) + if (containerPtr == NULL) return; if (eventPtr->type == MapNotify) { @@ -5742,7 +5742,7 @@ WmWaitVisibilityOrMapProc( } if (eventPtr->type == VisibilityNotify) { - int state = masterPtr->wmInfoPtr->hints.initial_state; + int state = containerPtr->wmInfoPtr->hints.initial_state; if ((state == NormalState) || (state == ZoomState)) { state = winPtr->wmInfoPtr->hints.initial_state; |