From d82d36721dc6e33b796cbb1892a8ced0b745c266 Mon Sep 17 00:00:00 2001 From: Lars Berger Date: Sun, 17 Sep 2023 14:51:08 +0800 Subject: [PATCH] feat: remove window animations cleanup in watcher --- GlazeWM.App.Watcher/WatcherStartup.cs | 14 ++------------ GlazeWM.Domain/UserConfigs/GeneralConfig.cs | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/GlazeWM.App.Watcher/WatcherStartup.cs b/GlazeWM.App.Watcher/WatcherStartup.cs index e25f8c409..eeed4de7f 100644 --- a/GlazeWM.App.Watcher/WatcherStartup.cs +++ b/GlazeWM.App.Watcher/WatcherStartup.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using GlazeWM.Domain.Common; using GlazeWM.Infrastructure.Common; -using GlazeWM.Infrastructure.WindowsApi; using static GlazeWM.Infrastructure.WindowsApi.WindowsApiService; namespace GlazeWM.App.Watcher @@ -12,19 +11,14 @@ namespace GlazeWM.App.Watcher public sealed class WatcherStartup { /// - /// Watcher is responsible for handling cleanup when the main process is killed - /// unexpectedly. This includes restoring all managed handles and restoring window - /// animation preferences. + /// Watcher is responsible for restoring all managed handles when the main process is + /// killed unexpectedly. /// public static async Task Run(int ipcServerPort) { var client = new IpcClient(ipcServerPort); var managedHandles = new List(); - // Get user's global setting for whether window animations are enabled. This - // needs to be restored on exit. - var animationsEnabled = SystemSettings.AreWindowAnimationsEnabled(); - try { await client.ConnectAsync(); @@ -54,10 +48,6 @@ public static async Task Run(int ipcServerPort) // Restore managed handles on failure to communicate with the main process' // IPC server. RestoreHandles(managedHandles); - - // Restore window animations setting to its initial value. - SystemSettings.SetWindowAnimationsEnabled(animationsEnabled); - await client.DisconnectAsync(); return ExitCode.Success; } diff --git a/GlazeWM.Domain/UserConfigs/GeneralConfig.cs b/GlazeWM.Domain/UserConfigs/GeneralConfig.cs index b5b6905b5..56628c2e2 100644 --- a/GlazeWM.Domain/UserConfigs/GeneralConfig.cs +++ b/GlazeWM.Domain/UserConfigs/GeneralConfig.cs @@ -25,6 +25,6 @@ public class GeneralConfig /// /// Whether to enable window transition animations (on minimize, close, etc). /// - public bool WindowAnimations { get; set; } + public bool WindowAnimations { get; set; } = true; } }