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

Window without on_close handler can't be closed with the window decoration #1872

Closed
freakboy3742 opened this issue Apr 16, 2023 · 2 comments · Fixed by #1877
Closed

Window without on_close handler can't be closed with the window decoration #1872

freakboy3742 opened this issue Apr 16, 2023 · 2 comments · Fixed by #1877
Labels
bug A crash or error in behavior. linux The issue relates Linux support. macOS The issue relates to Apple macOS support. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

Describe the bug

If a window is defined without an on_close handler, The close button (X or red button on the window frame) cannot be used to close the window

Steps to reproduce

  1. Run the windows example
  2. Click on the "create windows" button
  3. Try to close the window with "no on_close handler"

The window should, but will not close. There are no errors or log messages.

Programmatically invoking window.close() does work.

Expected behavior

The window should close.

Screenshots

No response

Environment

  • Operating System: Windows, macOS, Linux
  • Python version: All
  • Software versions:
    • Toga: 0.3.1

Logs

No response

Additional context

As a workaround, adding on_close=lambda w: True to the window will allow it to close.

This is likely caused by 0d9d43a from #1833.

@freakboy3742 freakboy3742 added bug A crash or error in behavior. linux The issue relates Linux support. macOS The issue relates to Apple macOS support. windows The issue relates to Microsoft Windows support. labels Apr 16, 2023
@mhsmith
Copy link
Member

mhsmith commented Apr 16, 2023

Overlaps with #1714.

@freakboy3742
Copy link
Member Author

There may be some conceptual overlap, but this is a specific regression in the on_close handler; this functionality worked in 0.3.0. #1714 is new (albeit definitely required) functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support. macOS The issue relates to Apple macOS support. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants