diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-11-30 09:12:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-11-30 09:12:42 (GMT) |
commit | 1e639f454d400f59c76463b1e9087974a6e827e0 (patch) | |
tree | 4c2507f8c64c8adfe7345037ee24fe5e7dec6d31 /macosx | |
parent | a39f501d79c524995811455bd9a8b41e9f40b807 (diff) | |
parent | e188af5aa7b4664fbfe25ff3f8153f91cdc60b24 (diff) | |
download | tk-1e639f454d400f59c76463b1e9087974a6e827e0.zip tk-1e639f454d400f59c76463b1e9087974a6e827e0.tar.gz tk-1e639f454d400f59c76463b1e9087974a6e827e0.tar.bz2 |
Restore core-8-6-branch timeline
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 64 |
2 files changed, 36 insertions, 30 deletions
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index edcd064..bda4c7c 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -800,7 +800,7 @@ ContainerEventProc( Tk_ErrorHandler errHandler; if (!firstContainerPtr) { - TKLog(@"Embedded window has nil container."); + TkMacOSXDbgMsg("Embedded window has nil container."); return; } /* diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 3ecb651..a68a87f 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -4674,44 +4674,50 @@ TkWmRestackToplevel( * below *all* siblings. */ { NSWindow *macWindow; - NSInteger otherMacWindowNumber; + NSWindow *otherMacWindow; + WmInfo *wmPtr = winPtr->wmInfoPtr; + int macAboveBelow = (aboveBelow == Above ? NSWindowAbove : NSWindowBelow); + int otherNumber = 0; /* 0 will be used when otherPtr is NULL. */ /* - * Get the mac window. Make sure it exists & is mapped. + * If the Tk windows has no drawable, or is withdrawn do nothing. */ - - if (winPtr->window == None) { - Tk_MakeWindowExist((Tk_Window) winPtr); + if (winPtr->window == None || + wmPtr == NULL || + wmPtr->hints.initial_state == WithdrawnState) { + return; + } + macWindow = TkMacOSXDrawableWindow(winPtr->window); + if (macWindow == nil) { + return; } - if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) { + if (otherPtr) { /* - * Can't set stacking order properly until the window is on the screen - * (mapping it may give it a reparent window), so make sure it's on - * the screen. + * When otherPtr is non-NULL, if the other window has no + * drawable or is withdrawn, do nothing. */ - - TkWmMapWindow(winPtr); + WmInfo *otherWmPtr = otherPtr->wmInfoPtr; + if (winPtr->window == None || + otherWmPtr == NULL || + otherWmPtr->hints.initial_state == WithdrawnState) { + return; + } + otherMacWindow = TkMacOSXDrawableWindow(otherPtr->window); + if (otherMacWindow == nil) { + return; + } else { + /* + * If the other window is OK, get its number. + */ + otherNumber = [otherMacWindow windowNumber]; + } } - macWindow = TkMacOSXDrawableWindow(winPtr->window); /* - * Get the window in which a raise or lower is in relation to. + * Just let the Mac window manager deal with all the subtleties + * of keeping track of off-screen windows, etc. */ - - if (otherPtr != NULL) { - if (otherPtr->window == None) { - Tk_MakeWindowExist((Tk_Window) otherPtr); - } - if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) { - TkWmMapWindow(otherPtr); - } - otherMacWindowNumber = [TkMacOSXDrawableWindow(otherPtr->window) - windowNumber]; - } else { - otherMacWindowNumber = 0; - } - [macWindow orderWindow:(aboveBelow == Above ? NSWindowAbove : NSWindowBelow) - relativeTo:otherMacWindowNumber]; + [macWindow orderWindow:macAboveBelow relativeTo:otherNumber]; } /* @@ -5237,7 +5243,7 @@ TkUnsupported1ObjCmd( }; Tk_Window tkwin = clientData; TkWindow *winPtr; - int index, i; + int index; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?"); |