Tk Source Code

View Ticket
Login
Ticket UUID: 897f6672f7f3dd3dd04b8b349b1cdc6e686be707
Title: Windows: wm deiconify restores a maximized window as normal
Type: Bug Version: 8.6.18, 9.0.5, 9.1.0
Submitter: serhiy.storchaka Created on: 2026-10-03 14:50:46
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-08 05:19:56
Resolution: Fixed Closed By: serhiy.storchaka
    Closed on: 2026-10-08 05:19:54
Description:

A toplevel maximized with wm state zoomed is restored to normal size after wm withdraw and wm deiconify:

wm state . zoomed
update; after 500
wm withdraw .
update; after 500
wm deiconify .
update
puts [wm state .]    ;# normal, expected zoomed

TkpWinToplevelDeiconify (win/tkWinWm.c) keeps the window maximized only if wmPtr->hints.initial_state == ZoomState, but ConfigureTopLevel sets initial_state to WithdrawnState when the window is hidden, so the window is always shown as normal.

X11 has the opposite problem, [fecd6bd2fa]. macOS restores the actual zoomed state (according to sources).

Proposed fix in branch win-deiconify-zoomed. Test wm-state-2.19.

User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-10-07 18:58:38:

Serhiy, many thanks for the ticket and the fix! Merged into main, core-9-0-branch, and core-8-6-branch by commits [eec7513d], [5309adea], and [f7bee941].