Tk Source Code
View Ticket
Not logged in
Tcl 2014 Conference, Portland/OR, US, Nov 10-14
Browse the schedule online.
Ticket UUID: d01ec103c0a87efb1ea6204eb9a7c0be4c981d0d
Title: After "wm withdraw .;wm state . iconic", "wm state ." always returns "withdrawn"
Type: Bug Version: 8.6.1
Submitter: oehhar Created on: 2014-01-23 14:05:19
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2014-01-30 14:51:47
Resolution: None Closed By: nobody
    Closed on:
Description:

Issue

When a tk window is started by the sequence "wm wtihdraw .;wm state . iconic", the command "wm state ." will return "withdrawn" and not "iconic".

Environment

  • Linux CentOS 6.5 64 bit
  • WM: Gnome
  • Tk 8.5.7, 8.6.0, 8.6.1

Demonstration

Having a file "wmt.tcl" like:

package require Tk
proc showstate {} {
    puts [wm state .]
    after 1000 showstate
}
wm withdraw .
wm state . iconic
after 1000 showstate

And starting by:

wish wmt.tcl

The printed result of "wm state ." is constantly "withdrawn".

Even if the window state is changed by the user by deiconifying the window, it still shows "withdrawn". Only an explicit command "wm state . normal" will change the returned state.

User Comments: anonymous (claiming to be sbron) added on 2014-01-30 14:51:47:
I reproduced the reported behavior on OpenSUSE 13.1, Tcl/Tk 8.6.1, KDE 4.11.2. It also happens when using [wm iconify .] instead of [wm state . iconic]

oehhar added on 2014-01-25 16:25:25:

Thank you, Joe, for the quiestions:

What window manager are you using?

I tested it on two systems

Thin Client with Ubuntu and Openbox and TCL 8.6.0

Virtual PC with CentOS and Gnome and TCL 8.5.7 and 8.6.1

When I click "About" in the gnome desktop, it returns:
  • CentOS 6.5
  • Kernel 2.6.32
  • Gnome 2.28.2 CentOS is often quite old. TCL is at 8.5.7 (why I also tested on 8.5.7). TCL/Tk 8.6.1 is compiled by me.

After [wm state . iconic], does the window actually reappear iconified (in the task bar, usually), or does the WM leave it withdrawn?

The window appears iconified.

The issue is that "wm state ." returns "withdrawn" but it should return "iconified".


jenglish added on 2014-01-24 14:27:23:
What window manager are you using?

After [wm state . iconic], does the window actually reappear iconified (in the task bar, usually), or does the WM leave it withdrawn?

Cannot replicate on my desktop (Gnome 2.28, metacity).