Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimizing dialogs hangs app #101

Closed
csatt opened this issue Mar 16, 2020 · 1 comment
Closed

Minimizing dialogs hangs app #101

csatt opened this issue Mar 16, 2020 · 1 comment
Assignees
Labels

Comments

@csatt
Copy link
Owner

csatt commented Mar 16, 2020

Dialogs that are "modal" (meaning they disable access to their parent window using grab_set()) cause the whole app to minimize and enter a state that cannot be gotten out of other than by forcibly killing the app. This appears to be a Python bug that was reported in 2016 (https://bugs.python.org/issue26340). That bug report was closed without a fix and without a good explanation.

There really isn't a good fix. Fortunately, there is no good reason to minimize such dialogs, so this won't be encountered often (it took me four years to encounter it for the first time).

Just to be a bit more user-friendly, a warning dialog should be generated where possible that tells the user that minimization is not supported. Unfortunately, this is just a "last gasp" before the application crashes. This is not possible for some of the simple dialogs.

@csatt csatt self-assigned this Mar 17, 2020
@csatt csatt added the bug label Mar 17, 2020
csatt added a commit that referenced this issue Mar 17, 2020
This "fix" just catches the minimization event and puts up an error dialog that explains the problem and that the app will probably crash as soon as it is closed. This is only for dialogs that are based on the "Dialog" class, such as the Preferences dialog and the help dialogs. The hope is that this will at least let the user know that they should not attempt to minimize dialogs. It would have been nice to just not have a minimize button on dialogs, but that doesn't appear to be possbile.
@csatt csatt closed this as completed Mar 17, 2020
@csatt csatt reopened this Jun 9, 2020
@csatt
Copy link
Owner Author

csatt commented Jun 9, 2020

The previous "fix" is bad. It triggers when the tabs in the Preferences dialog are selected, killing the app.

csatt added a commit that referenced this issue Jun 9, 2020
Back off previous "fix" for issue #101 which completely broke the tabs in the Preferences dialog.

This one actually fixes the problem - almost.  It turns out that removing the call to the resizable() method makes the problem disappear. By default tk.Toplevel widgets are resizable, so we just need to find a differen way to make non-resizable dialogs. This is done by setting both the minimum and maximum size to the current size.

Unfortunately, this solution has problems with the standalone version of the simulator dialog. But it works ok for the simulator dialog running under the IVS2 GUI.
@csatt csatt closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant