Skip to content

Fix macOS hotkey editor compatibility issues#616

Open
yuygfgg wants to merge 3 commits into
TypesettingTools:masterfrom
yuygfgg:master
Open

Fix macOS hotkey editor compatibility issues#616
yuygfgg wants to merge 3 commits into
TypesettingTools:masterfrom
yuygfgg:master

Conversation

@yuygfgg

@yuygfgg yuygfgg commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #357

Use the native wxDataViewChoiceRenderer for the hotkey command column on macOS, since wxWidgets does not fully support custom data view renderers there. The choice list is populated from the same registered command IDs used by other platforms, so automation commands use the normal command names without any macOS-specific lookup behavior.

Also fix a crash when deleting hotkeys on macOS by removing the item from the visible item list before erasing the underlying model object, avoiding a stale wxDataViewItem pointer being queried by NSOutlineView.

@arch1t3cht

Copy link
Copy Markdown
Member

Also fix a crash when deleting hotkeys on macOS by removing the item from the visible item list before erasing the underlying model object, avoiding a stale wxDataViewItem pointer being queried by NSOutlineView.

Was this crash purely due to incorrect wxWidgets usage in Aegisub, or was this also (maybe partially) a wxWidgets bug? If it's the latter, this should also be reported upstream.

@yuygfgg

yuygfgg commented Jul 7, 2026

Copy link
Copy Markdown
Author

Also fix a crash when deleting hotkeys on macOS by removing the item from the visible item list before erasing the underlying model object, avoiding a stale wxDataViewItem pointer being queried by NSOutlineView.

Was this crash purely due to incorrect wxWidgets usage in Aegisub, or was this also (maybe partially) a wxWidgets bug? If it's the latter, this should also be reported upstream.

This looks like incorrect usage on Aegisub’s side. We were still exposing the item through GetChildren() after telling wxWidgets it had been deleted. The backing object was then erased immediately afterwards, so wx / NSOutlineView could end up with a stale wxDataViewItem pointer. After removing it from the visible list before ItemDeleted(), wxWidgets no longer sees that stale item. wxWidgets could perhaps be more defensive on macOS, but I don’t think this is enough for a bug report.

@arch1t3cht

Copy link
Copy Markdown
Member

Thanks, I see now.

I had a chance to review the changes themselves now, and the code LGTM as far as I can see, but could you split it up into a few smaller commits? Something like

  1. Fix the crash on hotkey deletion
  2. Move the icon logic from HotkeyDataViewModel to the CommandRenderer
  3. Use the native wxDataViewChoiceRenderer on Mac.

@arch1t3cht arch1t3cht added this to the 3.5.0 milestone Jul 11, 2026
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.

Command field in hotkey list has no autocomplete on mac

2 participants