summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authormdejong <mdejong>2002-06-24 20:34:40 (GMT)
committermdejong <mdejong>2002-06-24 20:34:40 (GMT)
commitb2d10e52b29a853f6617b873da1152ac86f25d98 (patch)
treec3ddfdff422760f0f504dc54ece65afb4b22f916 /win
parent5301e3774409c2ecde99877add0448e84c972c93 (diff)
downloadtk-b2d10e52b29a853f6617b873da1152ac86f25d98.zip
tk-b2d10e52b29a853f6617b873da1152ac86f25d98.tar.gz
tk-b2d10e52b29a853f6617b873da1152ac86f25d98.tar.bz2
* tests/winWm.test: Verify that both an unmapped
and already mapped toplevel are raised and receive the focus when deiconified. * tests/wm.test: Add wm deiconify tests. Check that a toplevel that has never been mapped is not mapped by the deiconify command since it should be done at idle by MapFrame. * 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 bug 233150]
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 58c4c3d..b9ae2bd 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.45 2002/06/24 05:31:35 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.46 2002/06/24 20:34:40 mdejong Exp $
*/
#include "tkWinInt.h"
@@ -2436,11 +2436,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);
}
@@ -2456,6 +2457,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);