summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2017-11-30 09:12:42 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2017-11-30 09:12:42 (GMT)
commit9e0fe791462ee66197dac1dc7de933e5c80ac4db (patch)
tree4c2507f8c64c8adfe7345037ee24fe5e7dec6d31
parent3cca245b31eea56ace819a7df2ede5d36e74ee85 (diff)
parente3f09d92f17877606b9825d62ca4704b2a829c7f (diff)
downloadtk-9e0fe791462ee66197dac1dc7de933e5c80ac4db.zip
tk-9e0fe791462ee66197dac1dc7de933e5c80ac4db.tar.gz
tk-9e0fe791462ee66197dac1dc7de933e5c80ac4db.tar.bz2
Restore core-8-6-branch timeline
FossilOrigin-Name: ba66d26f3351d8eaad0dbeb1a029ec2e6da8308795d8513c6f1c2a6b528cc587
-rw-r--r--doc/raise.n3
-rw-r--r--macosx/tkMacOSXEmbed.c2
-rw-r--r--macosx/tkMacOSXWm.c64
3 files changed, 39 insertions, 30 deletions
diff --git a/doc/raise.n b/doc/raise.n
index be20c74..c8feb71 100644
--- a/doc/raise.n
+++ b/doc/raise.n
@@ -31,6 +31,9 @@ this could end up either raising or lowering \fIwindow\fR.
All \fBtoplevel\fR windows may be restacked with respect to each
other, whatever their relative path names, but the window manager is
not obligated to strictly honor requests to restack.
+.PP
+On macOS raising an iconified \fBtoplevel\fR window causes it to be
+deiconified.
.SH EXAMPLE
.PP
Make a button appear to be in a sibling frame that was created after
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 ...?");