App icon; language/theme follow Windows on first run; flush save on exit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,10 @@ namespace ReminderOrganizer
|
||||
base.OnStartup(e);
|
||||
|
||||
// Only one instance: a second start would show duplicate reminders and race on tasks.json.
|
||||
_singleInstance = new System.Threading.Mutex(true, "MichaelMedia.ReminderOrganizer", out var isFirst);
|
||||
// Test runs with their own data folder (REMINDER_ORGANIZER_DATA) get their own lock.
|
||||
var mutexName = "MichaelMedia.ReminderOrganizer" +
|
||||
(Environment.GetEnvironmentVariable("REMINDER_ORGANIZER_DATA") is { Length: > 0 } d ? "." + d.GetHashCode() : "");
|
||||
_singleInstance = new System.Threading.Mutex(true, mutexName, out var isFirst);
|
||||
if (!isFirst)
|
||||
{
|
||||
Shutdown();
|
||||
@@ -40,6 +43,7 @@ namespace ReminderOrganizer
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
(MainWindow as MainWindow)?.OnAppExit();
|
||||
Services.NotificationService.SharedTrayIcon?.Dispose();
|
||||
_singleInstance?.Dispose();
|
||||
base.OnExit(e);
|
||||
|
||||
Reference in New Issue
Block a user