Tk Source Code

View Ticket
Login
Ticket UUID: 220346
Title: wm transient does not map window correctly
Type: Bug Version: obsolete: 8.0p2
Submitter: welch Created on: 2000-10-31 23:16:53
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:34:52
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:34:52
Description:
OriginalBugID: 572 Bug
Version: 8.0p2
SubmitDate: '1998-05-11'
LastModified: '2000-01-06'
Severity: MED
Status: Released
Submitter: stanton
ChangedBy: hobbs
RelatedBugIDs: 2710
OS: All Windows
FixedDate: '2000-01-06'
FixedInVersion: 8.3b2


From: Mark Gammon <[email protected]> 

I think I have found a bug in the "wm transient" command.
Try the following:

   toplevel .t
   wm withdraw .t
   wm transient .t .

The "wm transient" command causes the toplevel to be mapped !

The culprit seems to be a line of code in tkWInWm.c that
handles the "wm transient" command:

line 2056:
    /*
    * Ensure that the transient window is either mapped or 
    * unmapped like its master.
    */


    TkpWmSetState(winPtr, NormalState);

Commenting this out seems to stop the unwanted mapping and doesn't
have any bad side-effects as far as I can see.

The proposed fix is incorrect also.  The correct solution should ensure that the parent state overrides the child state, but that the child state is honored if possible.  For example, if the parent is iconified or unmapped, the child should also be iconified or unmapped.  If the parent is normal, the child should use its own state to determine how to display itself.
--
A correct fix is in place for 8.3b2.  If the master is mapped, then
the transient keeps its state, unless it was Iconic, in which case
it will become Withdrawn.  If the master is not mapped, the state
for the transient window will become Withdrawn. 
-- 01/06/2000 hobbs