Skip to content

Commit

Permalink
feat: remove window animations cleanup in watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Sep 17, 2023
1 parent f6e1e66 commit d82d367
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions GlazeWM.App.Watcher/WatcherStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
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
{
public sealed class WatcherStartup
{
/// <summary>
/// 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.
/// </summary>
public static async Task<ExitCode> Run(int ipcServerPort)
{
var client = new IpcClient(ipcServerPort);
var managedHandles = new List<IntPtr>();

// 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();
Expand Down Expand Up @@ -54,10 +48,6 @@ public static async Task<ExitCode> 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;
}
Expand Down
2 changes: 1 addition & 1 deletion GlazeWM.Domain/UserConfigs/GeneralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class GeneralConfig
/// <summary>
/// Whether to enable window transition animations (on minimize, close, etc).
/// </summary>
public bool WindowAnimations { get; set; }
public bool WindowAnimations { get; set; } = true;
}
}

0 comments on commit d82d367

Please sign in to comment.