mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Fixed effects freezing when changing the active keyboard
This commit is contained in:
parent
e23a2078b7
commit
c924d5120a
@ -120,8 +120,15 @@ namespace Artemis.Managers
|
||||
|
||||
private void FinishStop(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
UpdateWorker.RunWorkerCompleted -= FinishStop;
|
||||
KeyboardManager.ReleaseActiveKeyboard();
|
||||
Running = false;
|
||||
|
||||
if (e.Error != null || !_restarting)
|
||||
return;
|
||||
|
||||
Start();
|
||||
_restarting = false;
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@ -161,23 +168,9 @@ namespace Artemis.Managers
|
||||
}
|
||||
|
||||
_restarting = true;
|
||||
|
||||
UpdateWorker.RunWorkerCompleted += FinishRestart;
|
||||
Stop();
|
||||
}
|
||||
|
||||
public void FinishRestart(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
UpdateWorker.RunWorkerCompleted -= FinishRestart;
|
||||
|
||||
if (e.Error != null)
|
||||
return;
|
||||
|
||||
Start();
|
||||
|
||||
_restarting = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the last active effect and starts the program
|
||||
/// </summary>
|
||||
|
||||
@ -34,13 +34,13 @@ namespace Artemis.Modules.Effects.Debug
|
||||
|
||||
KeyboardRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
|
||||
{
|
||||
Color.Red,
|
||||
Color.OrangeRed,
|
||||
Color.Yellow,
|
||||
//Color.Red,
|
||||
//Color.OrangeRed,
|
||||
//Color.Yellow,
|
||||
Color.Green,
|
||||
Color.Blue,
|
||||
Color.Purple,
|
||||
Color.DeepPink
|
||||
//Color.Purple,
|
||||
//Color.DeepPink
|
||||
}, LinearGradientMode.Horizontal);
|
||||
|
||||
Initialized = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user