Skip to content

Fix wx assertion error - #12363

Merged
feerrenrut merged 2 commits into
masterfrom
fixSettingsPanelDestructionError
May 6, 2021
Merged

Fix wx assertion error#12363
feerrenrut merged 2 commits into
masterfrom
fixSettingsPanelDestructionError

Conversation

@feerrenrut

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes: #12336
Fixes: #12220

Summary of the issue:

#12220 Causes a wx assertion message when either the Braille or Speech settings panels are open.
This seems to be related to the expando text control used on both panels.
The assertion is in wx's accessibility code, which has been introduced in our latest upgrade of wxPython.
The PR #12292 attempted to fix this by explicitly destroying the expando text control when closing.
In #12292 it was missed that the onSave callback was also called for the apply button.

Description of how this pull request fixes the issue:

While looking at adding an explicit close callback for panels, I noticed that Destroy was being called manually during the event handler.
Scheduling a destroy call after the event handler seems to resolve this issue.
As I understand, destroying children explicitly is not required.

While here also:

  • Tidy onSave / onApply
  • Add type info for 'catIdToInstanceMap' and 'categoryClasses'

Testing strategy:

Manually Testing
Open and exit settigns dialog speech/braille panel open via:

  • Save button
  • Cancel button
  • Close button
  • Apply followed by save

Open braille and speech panels, then open advanced panel, change a setting, apply and save.

Known issues with pull request:

The change that introduced the explicit destroy calls was part of a very large change, I don't know for sure if they were working around some other unwanted behaviour.

Change log entries:

None

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

Calling destroy inside an event handler seems to cause an error with wx
Accessibility GetDescription failing an assertion.

Destroying children explicitly is not required.

- Tidy onSave / onApply
- Add type info for 'catIdToInstanceMap' and 'categoryClasses'
@feerrenrut
feerrenrut requested a review from a team as a code owner May 5, 2021 02:58
@feerrenrut
feerrenrut requested a review from seanbudd May 5, 2021 02:58
@AppVeyorBot

This comment has been minimized.

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. I had a search for the origin of those destroy() calls on children and panels and didn't find any specific justification.

@feerrenrut
feerrenrut requested a review from LeonarddeR May 5, 2021 10:37
Comment thread source/gui/settingsDialogs.py
@feerrenrut
feerrenrut merged commit a3e983a into master May 6, 2021
@feerrenrut
feerrenrut deleted the fixSettingsPanelDestructionError branch May 6, 2021 08:16
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone May 6, 2021
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.

the nvda settings window is not closed wxAssertion error when closing braille or speech settings panels.

5 participants