diff --git a/CHANGELOG.md b/CHANGELOG.md index 36822e40..ae502c01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,11 @@ Versionsschema ist `x.x.x.x` (siehe `release.sh`). ### Behoben +- **Oberflaeche friert waehrend des Syncs nicht mehr ein.** Beim Tray-/Auto-Sync + lief die Sync-Engine auf dem UI-Thread, wodurch Fenster und Tray-Kontextmenue + blockierten (Menuepunkte reagierten nicht). Die Engine laeuft jetzt im + Hintergrund (`Task.Run`), die Tray-Meldungen werden thread-sicher auf den + UI-Thread marshalled. - **Dubletten bei Firmen-/Service-Eintraegen (nur Nummer + Firma).** Solche Eintraege wurden bei jedem Sync neu angelegt statt verknuepft, weil der Nummern-Abgleich feldgenau (geschaeftlich↔geschaeftlich) und formatabhaengig diff --git a/src/StarfaceOutlookSync/UI/MainForm.cs b/src/StarfaceOutlookSync/UI/MainForm.cs index 81cf540d..db965202 100644 --- a/src/StarfaceOutlookSync/UI/MainForm.cs +++ b/src/StarfaceOutlookSync/UI/MainForm.cs @@ -358,9 +358,11 @@ namespace StarfaceOutlookSync.UI { // Lokaler Guard, Lock-Datei, Konflikt-Notizen und Protokoll laufen // zentral im Coordinator (gemeinsam mit dem manuellen Sync-Pfad). + // WICHTIG: die Engine im Hintergrund laufen lassen, damit das + // Fenster und das Tray-Kontextmenue waehrend des Syncs reagieren. var outcome = await _coordinator.RunAsync( profile, - runEngine: () => _syncEngine.SyncProfileAsync(profile), + runEngine: () => Task.Run(() => _syncEngine.SyncProfileAsync(profile)), status: SetStatus); if (outcome.Skipped) @@ -426,7 +428,13 @@ namespace StarfaceOutlookSync.UI private void Balloon(int ms, string title, string text, ToolTipIcon icon, bool warn) { bool allow = warn ? _notifyWarn : _notifyGeneral; - if (allow) _trayIcon.ShowBalloonTip(ms, title, text, icon); + if (!allow) return; + if (InvokeRequired) + { + BeginInvoke(new Action(() => _trayIcon.ShowBalloonTip(ms, title, text, icon))); + return; + } + _trayIcon.ShowBalloonTip(ms, title, text, icon); } private void SetStatus(string text)