Skip to content

Fix macOS toolbar label disappearing on mouse capture#6829

Merged
OBattler merged 1 commit into
86Box:masterfrom
skiretic:fix-macos-toolbar-label-capture
Feb 21, 2026
Merged

Fix macOS toolbar label disappearing on mouse capture#6829
OBattler merged 1 commit into
86Box:masterfrom
skiretic:fix-macos-toolbar-label-capture

Conversation

@skiretic

Copy link
Copy Markdown
Contributor

Summary

  • BSD swprintf returns -1 when the format string or %ls argument contains non-ASCII wide characters under the C locale
  • On macOS, QKeySequence::NativeText produces Unicode key symbols (⌘ U+2318, ⌫ U+232B) in the release-mouse string, causing swprintf to zero out mouse_msg[1] and collapse the title bar label to empty during mouse capture
  • Fix: avoid swprintf for non-ASCII content on macOS — store message suffixes with wcsncpy and build the title string via wcsncat at the update site

Test plan

  • Tested on macOS (Apple Silicon) with Qt5 UI
  • Verified toolbar label persists correctly during mouse capture/release cycles

BSD swprintf fails (returns -1) when the format string or a %ls argument
contains non-ASCII wide characters under the C locale. On macOS,
QKeySequence::NativeText produces Unicode key symbols (⌘ U+2318,
⌫ U+232B) in the release-mouse string, causing swprintf to zero out
mouse_msg[1]. This made the title bar label collapse to empty during
mouse capture.

Avoid swprintf for non-ASCII content on macOS: store message suffixes
with wcsncpy and build the title string via wcsncat at the update site.
@OBattler OBattler merged commit 0b8d1dc into 86Box:master Feb 21, 2026
44 checks passed
@skiretic skiretic deleted the fix-macos-toolbar-label-capture branch March 13, 2026 01:03
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