Tk Source Code

View Ticket
Login
Ticket UUID: 2ef5dd8036432dddb04ea494a5556e84832bcc7
Title: Aqua: "pack forget" leaves window on screen
Type: Bug Version: 9.0 and later, 9.0.5, 9.1b1
Submitter: erikleunissen Created on: 2026-07-30 11:58:23
Subsystem: 48. Geometry Management Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-06 10:03:00
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-06 10:03:00
Description:
Observed with aqua/macOS Sequoia
- with Tk9.0.4 and Tk9.1b0
- not observed with Tk8.6.18.

To reproduce:

> wish9.0
% pack [frame .f -width 100 -height 100 -bg blue]
% pack forget .f

With Tk8.6.18 the blue frame disappears from the screen, and an <Expose> event
is generated for the Tk root window, all as expected.
With Tk9.0.4 and Tk9.1b1 the blue frame remains on screen and no <Expose>
event on the Tk root window is generated/serviced.

The attached script exercise.tcl can be used to reproduce the issue including
the handling of window events.
User Comments: jan.nijtmans added on 2026-10-06 10:03:00:

Fixed in [19dc130ec33220b0|trunk], also backported to core-9-0-branch

Many thanks!


serhiy.storchaka added on 2026-09-29 15:57:06:

Since 9.0, XUnmapWindow() does not redraw the toplevel when a non-toplevel window is unmapped, so the area from which the window was removed is not redrawn and no Expose events are generated. Since [fe5604ad44], XMapWindow() and XDestroyWindow() schedule the redraw in an idle task, but XUnmapWindow() does not. The same cause was found in [307b06cbc2].

Proposed fix in branch aqua-unmap-redraw: XUnmapWindow() schedules the same idle redraw. I could not test it, as I have no macOS.


Attachments: