Read Wine settings live at poll and spawn

Phase 2 of the Wine/Proton stage (decisions 3, 4, 16, 17, 19 in docs/testing/wine-proton.md): replace the Wine manager's startup snapshot with a live settings source read once per poll, so accepted global settings take effect with no reader restart. The source publishes only the active/global profile's Wine values; per-application profile switching never changes the governing list. A newly listed running program restarts its helper once in the same mode; removals and clearing the global switch never downgrade a running helper.
This commit is contained in:
hjozwiak committed 2026-11-02 01:15:33 -05:00
1 parent a60a251472
commit 9a10a15b68
13 files changed
+327 -51

No files matched your search

+11
View File
@@ -84,6 +84,17 @@ type preferencesWorker struct {
readSpeechDefaults func(context.Context, string) (speech.Settings, error)
}
// setGlobalSettings records a new active/global profile and republishes
// its global-only Wine values for the Wine manager. Per-application
// settings are cached separately and never pass through here, so focus
// changes cannot change the governing Wine list.
func (worker *preferencesWorker) setGlobalSettings(settings config.Settings) {
worker.globalSettings = settings
if worker.live != nil {
worker.live.StoreGlobalWine(settings.Wine)
}
}
func newPreferencesWorker(logger *slog.Logger, settings config.Settings, updater any) *preferencesWorker {
return &preferencesWorker{logger: logger, settings: settings, globalSettings: settings, appSettings: make(map[string]config.Settings), updater: updater,
extensionRequests: make(chan readerSettingsCall, 16), extensions: make(map[string]*readerExtension), speechCommands: make(chan input.Command, 16), remoteChanges: make(chan remoteSettingsChange, 16), discover: speech.Discover, readSpeechDefaults: speech.ReadDefaults, open: make(chan string, 1), applicationChanges: make(chan string, 1), done: make(chan struct{})}