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

Fix TextInput crash on Apple M1. Add noop select_file to cocoa.app.App to prevent an exception being raised #1406

Merged
merged 2 commits into from
Jan 20, 2022

Conversation

wtfuzz
Copy link
Contributor

@wtfuzz wtfuzz commented Jan 11, 2022

Added argtypes=[c_void_p] to the send_super call in TogaTextField.textDidEndEditing_()
This adds a noop mehtod for the select_file callback in toga_cocoa.app.App

TextInput crashes on Apple M1 silicon when losing focus
This exception is raised when creating a Toga app on macOS

Exception ignored on calling ctypes callback function: <rubicon.objc.api.objc_method object at 0x10796f7f0>
Traceback (most recent call last):
  File "/Users/fuzz/dev/dev-venv/lib/python3.10/site-packages/rubicon/objc/api.py", line 275, in __call__
    result = self.py_method(py_self, *args)
  File "/Users/fuzz/dev/dev-venv/lib/python3.10/site-packages/toga_cocoa/app.py", line 56, in applicationOpenUntitledFile_
    self.impl.select_file()
AttributeError: 'App' object has no attribute 'select_file'

PR Checklist:

  • [ X] All new features have been tested
  • [X ] All new features have been documented
  • [ X] I have read the CONTRIBUTING.md file
  • [ X] I will abide by the code of conduct

@wtfuzz wtfuzz changed the title add noop select_file to cocoa.app.App to prevent an exception being raised Fix TextInput crash on Apple M1. Add noop select_file to cocoa.app.App to prevent an exception being raised Jan 20, 2022
Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for the debugging work on this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants