mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-26 23:48:43 +02:00
As session switch can't launch browser and sessionending does nothing in window service mode, moved the events handler to run only in interactive mode
This commit is contained in:
parent
83e50d1313
commit
b2550f6dd3
|
@ -226,8 +226,6 @@ namespace MediaBrowser.ServerApplication
|
||||||
ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX);
|
ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
|
||||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
|
||||||
|
|
||||||
var task = _appHost.Init(initProgress);
|
var task = _appHost.Init(initProgress);
|
||||||
task = task.ContinueWith(new Action<Task>(a => _appHost.RunStartupTasks()));
|
task = task.ContinueWith(new Action<Task>(a => _appHost.RunStartupTasks()));
|
||||||
|
@ -239,7 +237,10 @@ namespace MediaBrowser.ServerApplication
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Task.WaitAll(task);
|
Task.WaitAll(task);
|
||||||
|
|
||||||
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||||
|
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||||
|
|
||||||
HideSplashScreen();
|
HideSplashScreen();
|
||||||
|
|
||||||
ShowTrayIcon();
|
ShowTrayIcon();
|
||||||
|
|
Loading…
Reference in a new issue