Remove unnecessary variable
This commit is contained in:
parent
e4e65aee92
commit
b5321df7f1
@ -206,7 +206,7 @@ public class Blur
|
|||||||
{
|
{
|
||||||
|
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
string prnt = $"Z-order changed\n{"Z",3} | {"hWnd",8} | {"PID",8} | {"Name",17} | {"Window Title",-17} | {"Vis",-8} | {"State",-13} | BBox\n";
|
string prnt = $"Z-order changed\n{"Z",3} | {"hWnd",8} | {"PID",8} | {"Name",17} | {"Window Title",-17} | {"State",-13} | BBox\n";
|
||||||
foreach (IntPtr windowHandle in neworder)
|
foreach (IntPtr windowHandle in neworder)
|
||||||
{
|
{
|
||||||
WindowInfo windowInfo = _windowManager.WindowInfos.FirstOrDefault(w => w.WindowHandle == windowHandle);
|
WindowInfo windowInfo = _windowManager.WindowInfos.FirstOrDefault(w => w.WindowHandle == windowHandle);
|
||||||
|
@ -5,17 +5,15 @@ namespace OBSBlur.Window;
|
|||||||
public struct WindowInfo
|
public struct WindowInfo
|
||||||
{
|
{
|
||||||
internal IntPtr WindowHandle { get; init; }
|
internal IntPtr WindowHandle { get; init; }
|
||||||
public bool IsVisible { get; init; }
|
|
||||||
public ShowWindowCommands WindowCommands { get; init; }
|
public ShowWindowCommands WindowCommands { get; init; }
|
||||||
public Rectangle WindowRectangle { get; init; }
|
public Rectangle WindowRectangle { get; init; }
|
||||||
public string WindowTitle { get; init; }
|
public string WindowTitle { get; init; }
|
||||||
public Process ProcessInfo { get; init; }
|
public Process ProcessInfo { get; init; }
|
||||||
|
|
||||||
public WindowInfo(IntPtr windowHandle, string windowTitle, Process processInfo, bool isWindowVisible, ShowWindowCommands windowCommands, Rectangle windowRectangle)
|
public WindowInfo(IntPtr windowHandle, string windowTitle, Process processInfo, ShowWindowCommands windowCommands, Rectangle windowRectangle)
|
||||||
{
|
{
|
||||||
this.WindowHandle = windowHandle;
|
this.WindowHandle = windowHandle;
|
||||||
this.ProcessInfo = processInfo;
|
this.ProcessInfo = processInfo;
|
||||||
this.IsVisible = isWindowVisible;
|
|
||||||
this.WindowCommands = windowCommands;
|
this.WindowCommands = windowCommands;
|
||||||
this.WindowRectangle = windowRectangle;
|
this.WindowRectangle = windowRectangle;
|
||||||
this.WindowTitle = windowTitle;
|
this.WindowTitle = windowTitle;
|
||||||
@ -29,7 +27,6 @@ public struct WindowInfo
|
|||||||
public bool Equals(WindowInfo other)
|
public bool Equals(WindowInfo other)
|
||||||
{
|
{
|
||||||
return WindowHandle == other.WindowHandle &&
|
return WindowHandle == other.WindowHandle &&
|
||||||
IsVisible == other.IsVisible &&
|
|
||||||
WindowCommands == other.WindowCommands &&
|
WindowCommands == other.WindowCommands &&
|
||||||
WindowRectangle == other.WindowRectangle &&
|
WindowRectangle == other.WindowRectangle &&
|
||||||
WindowTitle.Equals(other.WindowTitle) &&
|
WindowTitle.Equals(other.WindowTitle) &&
|
||||||
@ -39,7 +36,7 @@ public struct WindowInfo
|
|||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
return HashCode.Combine(WindowHandle, IsVisible, WindowTitle, ProcessInfo);
|
return HashCode.Combine(WindowHandle, WindowTitle, ProcessInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
@ -47,6 +44,6 @@ public struct WindowInfo
|
|||||||
const int cutoffStr = 17;
|
const int cutoffStr = 17;
|
||||||
string processNameStr = ProcessInfo.ProcessName.Substring(0, Math.Min(cutoffStr, ProcessInfo.ProcessName.Length));
|
string processNameStr = ProcessInfo.ProcessName.Substring(0, Math.Min(cutoffStr, ProcessInfo.ProcessName.Length));
|
||||||
string windowTitleStr = WindowTitle.Substring(0, Math.Min(cutoffStr, WindowTitle.Length));
|
string windowTitleStr = WindowTitle.Substring(0, Math.Min(cutoffStr, WindowTitle.Length));
|
||||||
return $"{WindowHandle,8} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {(IsVisible ? "visible" : "hidden"),-8} | {WindowCommands,-13} | {WindowRectangle}";
|
return $"{WindowHandle,8} | {ProcessInfo.Id,8} | {processNameStr,cutoffStr} | {windowTitleStr,-cutoffStr} | {WindowCommands,-13} | {WindowRectangle}";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -80,7 +80,7 @@ public partial class WindowManager : IDisposable
|
|||||||
Rectangle rect;
|
Rectangle rect;
|
||||||
GetWindowRect(windowHandle, out rect);
|
GetWindowRect(windowHandle, out rect);
|
||||||
|
|
||||||
_windows.Add(new WindowInfo(windowHandle, windowTitle, processInfo, isVisible, placement.ShowCmd, rect));
|
_windows.Add(new WindowInfo(windowHandle, windowTitle, processInfo, placement.ShowCmd, rect));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user