mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Awake]Don't exit from tray icon unless standalone (#22232)
This commit is contained in:
@@ -44,6 +44,8 @@ namespace Awake
|
||||
private static FileSystemWatcher? _watcher;
|
||||
private static SettingsUtils? _settingsUtils;
|
||||
|
||||
private static bool _startedFromPowerToys;
|
||||
|
||||
public static Mutex LockMutex { get => _mutex; set => _mutex = value; }
|
||||
|
||||
private static Logger? _log;
|
||||
@@ -188,6 +190,10 @@ namespace Awake
|
||||
_log.Info("No PID specified. Allocating console...");
|
||||
APIHelper.AllocateConsole();
|
||||
}
|
||||
else
|
||||
{
|
||||
_startedFromPowerToys = true;
|
||||
}
|
||||
|
||||
_log.Info($"The value for --use-pt-config is: {usePtConfig}");
|
||||
_log.Info($"The value for --display-on is: {displayOn}");
|
||||
@@ -238,7 +244,7 @@ namespace Awake
|
||||
.Select(e => e.EventArgs)
|
||||
.Subscribe(HandleAwakeConfigChange);
|
||||
|
||||
TrayHelper.SetTray(InternalConstants.FullAppName, new AwakeSettings());
|
||||
TrayHelper.SetTray(InternalConstants.FullAppName, new AwakeSettings(), _startedFromPowerToys);
|
||||
|
||||
// Initially the file might not be updated, so we need to start processing
|
||||
// settings right away.
|
||||
@@ -330,7 +336,7 @@ namespace Awake
|
||||
}
|
||||
}
|
||||
|
||||
TrayHelper.SetTray(InternalConstants.FullAppName, settings);
|
||||
TrayHelper.SetTray(InternalConstants.FullAppName, settings, _startedFromPowerToys);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user