Tk Source Code

View Ticket
Login
Ticket UUID: 220628
Title: Bug of "wm deiconify"
Type: Bug Version: final: 8.0.5
Submitter: welch Created on: 2000-10-31 23:48:39
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:19:55
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:19:55
Description:
OriginalBugID: 3687 Bug
Version: 8.0.5
SubmitDate: '1999-11-24'
LastModified: '1999-12-14'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Windows 95
OSVersion: Windows 95/98/NT
Machine: Windows95/P133
FixedDate: '1999-12-14'
FixedInVersion: 8.3b1


Name: Chengye Mao



Comments:

I tested the modification for Tk8.0 and it worked fine.

The same bug can also be found in Tk 8.1.x, 8.2.x and

the fix should be the same.



ReproducibleScript:

#Script 1:

tk_dialog .d Test Test warning 1 Ok Quit





#Script 2:

toplevel .t

wm withdraw .t; wm geom .t +300+20; wm deiconify .t



ObservedBehavior:

In Scripts 1 and 2, both the dialog window .d and 

the toplevel window .t were positioned at wrong places.



DesiredBehavior:

The dialog window .d should be at the screen center and

the toplevel .t should be at (x=300,y=20)



Patch:

/* 

    the following are the modified code segment of "wm deiconify" 

    in source file "tkWinWm.c", starting from line# 1310.

*/



    } else if ((c == 'd') && (strncmp(argv[1], "deiconify", length) == 0)) {

if (argc != 3) {

    Tcl_AppendResult(interp, "wrong # arguments: must be \"",

    argv[0], " deiconify window\"", (char *) NULL);

    return TCL_ERROR;

}

if (wmPtr->iconFor != NULL) {

    Tcl_AppendResult(interp, "can't deiconify ", argv[2],

    ": it is an icon for ", winPtr->pathName, (char *) NULL);

    return TCL_ERROR;

}

        if (winPtr->flags & TK_EMBEDDED) {

            Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,

                    ": it is an embedded window", (char *) NULL);

            return TCL_ERROR;

        }



        /*

        11/14/99 Chengye Mao. The following if statement takes care

        the problem.



        If WM_UPDATE_PENDING is true, a pending UpdateGeometryInfo may

        need to be called first to update a withdrew toplevel's geometry

        before it is deiconified by TkpWmSetState.



        UpdateGeometryInfo has no effect on an iconified toplevel.

        */



        if (wmPtr->flags & WM_UPDATE_PENDING) {

            Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);

            UpdateGeometryInfo((ClientData) winPtr);

        }



TkpWmSetState(winPtr, NormalState);



PatchFiles:

Affected file: tkWinWm.c





Added to 8.3b1. 
-- 12/14/1999 hobbs