This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE should not make About be a transient of withdrawn root window
Type: behavior Stage:
Components: IDLE, macOS Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: culler, ned.deily, taleinat, terry.reedy
Priority: normal Keywords:

Created on 2019-11-21 18:41 by culler, last changed 2022-04-11 14:59 by admin.

Messages (8)
msg357195 - (view) Author: Marc Culler (culler) * Date: 2019-11-21 18:41
The soon-to-be-released Tcl/Tk 8.6.10 includes some changes to the macOS
port which cause the wm transient command to behave in the way that the
Tk manual says it should:

  "A transient window will mirror state changes in the master and
   inherit the state of the master when initially mapped."

This means that a transient of a withdrawn window will be withdrawn.  In
the macOS version of IDLE the about dialog is assigned as a transient
of the root window which is withdrawn, so the dialog does not appear on
the screen.  Consequently, activating the about menu will cause IDLE
to become unresponsive as it waits for an offscreen window to be closed.

Deleting line 28 in aboutDialog.py:

        self.transient(parent)

makes the about dialog behave normally.
msg357241 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-11-22 04:22
The NMT doc adds "A transient window always appears in front of its parent." and I believe that this is why we use it and why I would not want to unconditionally delete the calls without thorough testing on both Linux and Windows.

IDLE calls this function for configdialog, its config-key subdialog, all query, search, and textview windows, help-about, and the IDLE-help doc window.  I believe in all cases the parent is normally an editor-base window.  There are also the tk/inter color and save dialogs.  The same may be true for them, but ultimately all should be tested both with menu clicks and hot keys.

Configdialog and about-IDLE are special in that their menu entries are transferred to the 'IDLE' submenu that macOS adds to the app menu.  So macosx.py has event handlers that make root the parent.  Both of these popup, on my Macbook, to the right of the centerline.  From what you say, at least these two should have conditional transient calls.

For reasons I don't understand (obsolete history?), there is also a mac-specific root-parent event handler for IDLE-help, even though that is left on the Help submenu, and popup up on top the the current window.

I can only test on my Macbook with installed Python (3.7.5, 3.8.0) and tk 8.6.9.  Are all tk versions earlier than 8.6.10 the same?
msg357289 - (view) Author: Marc Culler (culler) * Date: 2019-11-22 14:19
It definitely makes sense for an on-screen window to have a transient
dialog.  With a little care (see "messages boxes" in the widget demo)
on the mac the transient can be a "sheet" that opens from the top of
the master window.  It even makes sense for an iconified window to have
a transient since the window manager still controls iconified windows.
But a withdrawn window, with no icon (and no listing in the mac Window 
menu) is beyond the user's control.  The really deadly combination is
when a transient of a withdrawn window (so the transient is withdrawn)
also has a grab on mouse and keyboard events.  That one should be
avoided.  It is not clear to me why Tk allows it. I believe it should
be avoided on all platforms, since withdrawn windows are supposed to
be completely removed from the window manager and only known to Tk.
But testing is needed, of course.

I don't know the full history.  I know there were changes between 8.6.9
and 8.6.10 needed to bring the mac port to its current state where it
passes all of the Tk regression tests. (That is not the case with unix
at the moment and I know there are many issues with iconified and
withdrawn windows in Gnome 3 due to changes in window manager behavior
which have not been fully incorporated into Tk.) I suspect there were
many prior releases with no changes to this behavior on the mac.

PS The formerly soon-to-be-released 8.6.10 has now been released.
msg357291 - (view) Author: Marc Culler (culler) * Date: 2019-11-22 14:28
I should have mentioned that I did not see the IDLE hang with Python 3,
only with Python 2.7.  So I changed the Version in the ticket.
msg357316 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-11-22 19:41
Ned, is our last Mac installer for 2.7 going to use tk 8.6.10?

I am extremely reluctant to touch IDLE for 2.7 since beginners are nearly all using 3.x and any mistakes are forever.
msg357317 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-11-22 19:50
I still want to look at what happens on 3.x.
msg357320 - (view) Author: Marc Culler (culler) * Date: 2019-11-22 20:39
One thing to keep in mind is that Apple's release of OSX 10.14.6 caused
Tk 8.6.8 to stop working on many systems in an extremely obnoxious way.
Starting a Tk Application would trigger a segfault in Apple's WindowServer
which would then cause the user to be immediately logged out. That does
not happen with 8.6.10.  (Other types of applications were also affected.)

Here is one of many bug reports:
 https://github.com/matplotlib/matplotlib/issues/14999

Whether the crash would occur depended on which Apple hardware was used.
msg359557 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-01-07 22:36
2.7 is EOL.
History
Date User Action Args
2022-04-11 14:59:23adminsetgithub: 83063
2020-01-07 22:36:02terry.reedysetnosy: - ronaldoussoren
title: IDLE should not make the about dialog be a transient of the withdrawn root window -> IDLE should not make About be a transient of withdrawn root window
messages: + msg359557

versions: - Python 2.7
2019-11-22 20:39:37cullersetmessages: + msg357320
2019-11-22 19:50:39terry.reedysetmessages: + msg357317
versions: + Python 3.9
2019-11-22 19:41:35terry.reedysetmessages: + msg357316
2019-11-22 17:15:12cullersetversions: + Python 2.7, - Python 3.7
2019-11-22 14:28:37cullersetmessages: + msg357291
versions: + Python 3.7, - Python 3.8
2019-11-22 14:19:57cullersetmessages: + msg357289
2019-11-22 04:22:21terry.reedysetnosy: + ned.deily, taleinat, ronaldoussoren
messages: + msg357241
components: + macOS
2019-11-21 18:41:20cullercreate