Tk Source Code

View Ticket
Login
2026-10-08
05:19 • Closed ticket [897f6672]: Windows: wm deiconify restores a maximized window as normal plus 3 other changes artifact: f48fefc5 user: serhiy.storchaka
2026-10-07
18:58 • Ticket [897f6672]: 6 changes artifact: 181ab0d0 user: nemethi
18:03
Fix for [897f6672f7]: Windows: wm deiconify restores a maximized window as normal. check-in: f7bee941 user: csaba tags: core-8-6-branch
17:57
Fix for [897f6672f7]: Windows: wm deiconify restores a maximized window as normal. check-in: 5309adea user: csaba tags: core-9-0-branch
17:49
Fix for [897f6672f7]: Windows: wm deiconify restores a maximized window as normal. check-in: eec7513d user: csaba tags: trunk, main
2026-10-03
15:12 • Ticket [fecd6bd2] linux only: window -zoomed attribute is restored when it should not be. status still Open with 4 other changes artifact: 96bd88f2 user: serhiy.storchaka
14:50 • New ticket [897f6672] Windows: wm deiconify restores a maximized window as normal. artifact: 0287e173 user: serhiy.storchaka
14:49
Fix [897f6672f7]: Windows: wm deiconify restores a maximized window as normal. TkpWinToplevelDeiconify only checked the ZoomState, which the window loses when withdrawn; also check the maximized style of the hidden wrapper. closed check-in: 4ee04b9e user: serhiy.storchaka tags: win-deiconify-zoomed

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].