OSDN Git Service

From Mo Dejong <supermo@bayarea.net>:
authorkseitz <kseitz>
Fri, 13 Sep 2002 14:43:07 +0000 (14:43 +0000)
committerkseitz <kseitz>
Fri, 13 Sep 2002 14:43:07 +0000 (14:43 +0000)
        * 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
tk/win/tkWinWm.c

index 7aab61a..d6f0e46 100644 (file)
@@ -1,3 +1,18 @@
+2002-09-13  Keith Seitz  <keiths@redhat.com>
+
+       From Mo Dejong  <supermo@bayarea.net>:
+       * 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  <keiths@redhat.com>
 
        * win/winMain.c (main): Ifdef out for cygwin.
index 8f7ba87..9ee8076 100644 (file)
@@ -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);