Testing a Merge fix

This commit is contained in:
Eric Vasquez
2024-11-10 18:24:17 -06:00
parent 63fe0846aa
commit 1eafad0159
37 changed files with 1605 additions and 2013 deletions

View File

@@ -102,7 +102,7 @@ namespace EveOPreview.Services
{
this.GetActiveClient()?.ClearBorder();
this._windowManager.ActivateWindow(newClient.Key);
this._windowManager.ActivateWindow(newClient.Key, this._configuration.MinimizeInactiveClientsAnimation);
this.SwitchActiveClient(newClient.Key, newClient.Value.Title);
newClient.Value.SetHighlight();
@@ -483,7 +483,7 @@ namespace EveOPreview.Services
// Minimize the currently active client if needed
if (this._configuration.MinimizeInactiveClients && !this._configuration.IsPriorityClient(this._activeClient.Title))
{
this._windowManager.MinimizeWindow(this._activeClient.Handle, false);
this._windowManager.MinimizeWindow(this._activeClient.Handle, this._configuration.MinimizeInactiveClientsAnimation);
}
this._activeClient = (foregroundClientHandle, foregroundClientTitle);
@@ -534,7 +534,7 @@ namespace EveOPreview.Services
Task.Run(() =>
{
this._windowManager.ActivateWindow(view.Id);
this._windowManager.ActivateWindow(view.Id, this._configuration.MinimizeInactiveClientsAnimation);
})
.ContinueWith((task) =>
{
@@ -549,7 +549,7 @@ namespace EveOPreview.Services
{
if (switchOut)
{
this._windowManager.ActivateWindow(this._externalApplication);
this._windowManager.ActivateWindow(this._externalApplication, this._configuration.MinimizeInactiveClientsAnimation);
}
else
{
@@ -558,7 +558,7 @@ namespace EveOPreview.Services
return;
}
this._windowManager.MinimizeWindow(view.Id, true);
this._windowManager.MinimizeWindow(view.Id, this._configuration.MinimizeInactiveClientsAnimation);
this.RefreshThumbnails();
}
}
@@ -740,7 +740,7 @@ namespace EveOPreview.Services
if (clientLayout.IsMaximized)
{
this._windowManager.MaximizeWindow(clientHandle);
this._windowManager.MaximizeWindow(clientHandle, this._configuration.MinimizeInactiveClientsAnimation);
}
else
{

View File

@@ -27,7 +27,7 @@ namespace EveOPreview.Services.Implementation
return User32NativeMethods.GetForegroundWindow();
}
public void ActivateWindow(IntPtr handle)
public void ActivateWindow(IntPtr handle, bool enableAnimation)
{
User32NativeMethods.SetForegroundWindow(handle);
User32NativeMethods.SetFocus(handle);
@@ -36,8 +36,30 @@ namespace EveOPreview.Services.Implementation
if ((style & InteropConstants.WS_MINIMIZE) == InteropConstants.WS_MINIMIZE)
{
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
}
if (enableAnimation)
{
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
}
else
{
ANIMATIONINFO param = new ANIMATIONINFO();
param.cbSize = (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO));
// Store the current Animation Setting
var ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
int currentAnimationSetting = param.iMinAnimate;
// Turn off Animation
param.iMinAnimate = 0;
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
// Restore current Animation Settings
param.iMinAnimate = currentAnimationSetting;
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
}
}
}
public void MinimizeWindow(IntPtr handle, bool enableAnimation)
@@ -48,12 +70,23 @@ namespace EveOPreview.Services.Implementation
}
else
{
WINDOWPLACEMENT param = new WINDOWPLACEMENT();
param.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
User32NativeMethods.GetWindowPlacement(handle, ref param);
param.showCmd = WINDOWPLACEMENT.SW_MINIMIZE;
User32NativeMethods.SetWindowPlacement(handle, ref param);
}
ANIMATIONINFO param = new ANIMATIONINFO();
param.cbSize = (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO));
// Store Current Animation Setting
var ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
int currentAnimationSetting = param.iMinAnimate;
// Turn off Animation
param.iMinAnimate = 0;
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
// Restore current Animation Settings
param.iMinAnimate = currentAnimationSetting;
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
}
}
public void MoveWindow(IntPtr handle, int left, int top, int width, int height)
@@ -61,10 +94,22 @@ namespace EveOPreview.Services.Implementation
User32NativeMethods.MoveWindow(handle, left, top, width, height, true);
}
public void MaximizeWindow(IntPtr handle)
public void MaximizeWindow(IntPtr handle, bool enableAnimation)
{
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_SHOWMAXIMIZED);
}
if (enableAnimation)
{
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_SHOWMAXIMIZED);
}
else
{
WINDOWPLACEMENT param = new WINDOWPLACEMENT();
param.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
User32NativeMethods.GetWindowPlacement(handle, ref param);
param.showCmd = WINDOWPLACEMENT.SW_MINIMIZE;
User32NativeMethods.SetWindowPlacement(handle, ref param);
}
}
public (int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle)
{