Skip to content

Fix SingleApplication IPC reliability and add font style selection#1092

Open
blreay wants to merge 1 commit into
dail8859:masterfrom
blreay:fix-single-app-ipc-reliability-compact
Open

Fix SingleApplication IPC reliability and add font style selection#1092
blreay wants to merge 1 commit into
dail8859:masterfrom
blreay:fix-single-app-ipc-reliability-compact

Conversation

@blreay

@blreay blreay commented Jul 15, 2026

Copy link
Copy Markdown
  1. Fix unreliable SingleApplication IPC message delivery

The default sendMessage() timeout of 100ms is insufficient when the primary instance's event loop is temporarily blocked by session auto-save (every 60s), file-change detection, or modal dialogs. This causes the secondary instance to activate the primary's window (via instanceStarted signal) but fail to deliver the file path (via sendMessage), resulting in "window activates but file doesn't open" behavior.

  • Increase sendMessage() timeout from 100ms to 1000ms per attempt
  • Add retry logic (3 attempts) to handle transient event-loop blocking
  • Show QMessageBox warning on total failure instead of silent exit
  • Change sendInfoToPrimaryInstance() return type to bool

Ref: upstream SingleApplication issue, NotepadNext #541

  1. Add font style selection to support Light/Thin font variants

Qt 6 merges font family variants (Regular, Light, Bold, etc.) under a single family name in QFontComboBox, making variants like 'Sarasa Fixed SC Nerd Font Light' invisible in the font picker.

  • Replace QFontComboBox with QComboBox + style QComboBox in Preferences
  • Populate families via QFontDatabase::families(), styles via QFontDatabase::styles(family) with cascading updates
  • Add FontStyle setting to ApplicationSettings (persisted as style name)
  • Map selected style to Scintilla weight/italic via styleSetWeight() and styleSetItalic() in EditorManager (initial setup + live updates)
  • Use this->settings in lambdas for MSVC -permissive- compatibility
  1. Add documentation for both changes in doc/

@blreay blreay force-pushed the fix-single-app-ipc-reliability-compact branch 6 times, most recently from c5109c7 to 382aa14 Compare July 15, 2026 16:02
1. Fix unreliable SingleApplication IPC message delivery

The default sendMessage() timeout of 100ms is insufficient when the
primary instance's event loop is temporarily blocked by session auto-save
(every 60s), file-change detection, or modal dialogs. This causes the
secondary instance to activate the primary's window (via instanceStarted
signal) but fail to deliver the file path (via sendMessage), resulting in
"window activates but file doesn't open" behavior.

- Increase sendMessage() timeout from 100ms to 1000ms per attempt
- Add retry logic (3 attempts) to handle transient event-loop blocking
- Show QMessageBox warning on total failure instead of silent exit
- Change sendInfoToPrimaryInstance() return type to bool

Ref: upstream SingleApplication issue, NotepadNext dail8859#541

2. Add font style selection to support Light/Thin font variants

Qt 6 merges font family variants (Regular, Light, Bold, etc.) under a
single family name in QFontComboBox, making variants like 'Sarasa Fixed
SC Nerd Font Light' invisible in the font picker.

- Replace QFontComboBox with QComboBox + style QComboBox in Preferences
- Populate families via QFontDatabase::families(), styles via
  QFontDatabase::styles(family) with cascading updates
- Add FontStyle setting to ApplicationSettings (persisted as style name)
- Map selected style to Scintilla weight/italic via styleSetWeight() and
  styleSetItalic() in EditorManager (initial setup + live updates)
- Use this->settings in lambdas for MSVC -permissive- compatibility

3. Add documentation for both changes in doc/

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@blreay blreay force-pushed the fix-single-app-ipc-reliability-compact branch from 382aa14 to 09c3ca3 Compare July 15, 2026 16:09
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.

1 participant