From bc8a5ab0410bd8bdb58e711d7a408bbe2de6b8d1 Mon Sep 17 00:00:00 2001 From: kseitz Date: Fri, 13 Sep 2002 14:43:07 +0000 Subject: [PATCH] From Mo Dejong : * win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED flag while processing the wm deiconify command. The WM_UPDATE_PENDING flag should never be set when WM_NEVER_MAPPED is set, but double check so that the implementation is more explicit and matches the comment just above. Return without invoking TkWmRestackToplevel or TkSetFocusWin on a toplevel that has never been mapped. This fixes a bug where a toplevel is mapped with the wrong size and is then resized by the idle call to MapFrame. --- tk/ChangeLog | 15 +++++++++++++++ tk/win/tkWinWm.c | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tk/ChangeLog b/tk/ChangeLog index 7aab61a4cc..d6f0e463b2 100644 --- a/tk/ChangeLog +++ b/tk/ChangeLog @@ -1,3 +1,18 @@ +2002-09-13 Keith Seitz + + From Mo Dejong : + * win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED + flag while processing the wm deiconify command. + The WM_UPDATE_PENDING flag should never be set when + WM_NEVER_MAPPED is set, but double check so that + the implementation is more explicit and matches + the comment just above. + Return without invoking TkWmRestackToplevel or + TkSetFocusWin on a toplevel that has never been + mapped. This fixes a bug where a toplevel is mapped + with the wrong size and is then resized by the + idle call to MapFrame. + 2002-07-31 Keith Seitz * win/winMain.c (main): Ifdef out for cygwin. diff --git a/tk/win/tkWinWm.c b/tk/win/tkWinWm.c index 8f7ba87d99..9ee8076b24 100644 --- a/tk/win/tkWinWm.c +++ b/tk/win/tkWinWm.c @@ -1453,11 +1453,12 @@ Tk_WmCmd(clientData, interp, argc, argv) } /* * If WM_UPDATE_PENDING is true, a pending UpdateGeometryInfo may - * need to be called first to update a withdrew toplevel's geometry + * need to be called first to update a withdrawn toplevel's geometry * before it is deiconified by TkpWmSetState. * Don't bother if we've never been mapped. */ - if (wmPtr->flags & WM_UPDATE_PENDING) { + if ((wmPtr->flags & WM_UPDATE_PENDING) && + !(wmPtr->flags & WM_NEVER_MAPPED)) { Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); UpdateGeometryInfo((ClientData) winPtr); } @@ -1473,6 +1474,15 @@ Tk_WmCmd(clientData, interp, argc, argv) } /* + * An unmapped window will be mapped at idle time + * by a call to MapFrame. That calls CreateWrapper + * which sets the focus and raises the window. + */ + if (wmPtr->flags & WM_NEVER_MAPPED) { + return TCL_OK; + } + + /* * Follow Windows-like style here, raising the window to the top. */ TkWmRestackToplevel(winPtr, Above, NULL); -- 2.11.0