Tk Source Code

View Ticket
Login
Ticket UUID: 67384bce7d1e219e7a9c41dc707a7be892e13231
Title: Side effects of destroying an embedded window depend on the OS
Type: Bug Version: 8.6.9
Submitter: marc_culler Created on: 2019-01-24 00:23:26
Subsystem: 65. Generic Window Operations Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2019-05-26 19:04:51
Resolution: None Closed By: nobody
    Closed on:
Description:
With the current core-8-6-branch tip, in unix (Ubuntu 18.04) and macOS destroying
an embedded window causes its container to also be destroyed.  In Windows the
container is not destroyed.  The test winfo-13.2 checks for this behavior.  It
passes on Windows and fails on Ubuntu and macOS.

Which behavior is correct?
User Comments: fvogel added on 2019-05-26 19:04:51:

Based on Tcl Core list discussion, Marc committed [02ca3773] which adapts the expected result for winfo-13.2 to the platform running the test.

Windows does not destroy the container when an embedded window is destroyed, but Unix and macOS do destroy it. This behavior is unchanged, and the expected result for the tests were adapted to this platform difference.

The present ticket is left open until the question of whether to change the Windows behavior is resolved. Thoughts and opinions welcome!


marc_culler (claiming to be Marc Culler) added on 2019-05-24 12:45:11:
Note that the tests unixEmbed-2.4 and unixEmbed-3.7a expect the opposite behavior from winfo-13.2.  Those two tests only pass if the container is destroyed while winfo-13.2 only passes if the container is not destroyed.

marc_culler (claiming to be Marc Culler) added on 2019-01-25 16:03:14:

Also, the expected result:

[expr [winfo exists .emb.b] || [winfo exists .con]] == 0

is different from the current expected result, which is equivalent to:

[expr ([winfo exists .emb.b] == 0) && ([winfo exists .con]] == 1)]

Note that the commit comment for [18e29f31] says: "Killing a contained window should not destroy the container." But the unix port (and now the macOS port as well) explicitly do destroy the container.


fvogel added on 2019-01-25 05:42:04:

Sorry I was probably not fully awaken when I wrote this. The expected result of this test did change. This happened here.


fvogel added on 2019-01-25 05:02:36:

At the beginning of time winfo-13.2 already checked that when an embedded window gets destroyed then the container is not destroyed.

It was originally expressed as [expr [winfo exists .emb.b] || [winfo exists .con]] == 0. See line 316 here.

So this is an old test and its expected result didn't change. I guess it passed in the past on all platforms (at least on unix - we know that the macOS port didn't bother too much with the test suite results)...?