From dc1d6ad60be93b11fd73a8b79d2048f4084e0ddd Mon Sep 17 00:00:00 2001 From: Noethix55555 <277300782+Noethix55555@users.noreply.github.com> Date: Wed, 17 Jun 2026 20:12:03 -0400 Subject: [PATCH] fix: move-window top/bottom/center ignore working area offset top used absolute y=0 instead of workingArea.Top; bottom used workingArea.Height-Height instead of workingArea.Bottom-Height; center used screen.Bounds instead of workingArea. All three misplace the window when a taskbar is present or on non-primary monitors where the working area Y origin is non-zero. --- src/MpvNet.Windows/WinForms/MainForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MpvNet.Windows/WinForms/MainForm.cs b/src/MpvNet.Windows/WinForms/MainForm.cs index 7a12acb6..e9dfaa8a 100644 --- a/src/MpvNet.Windows/WinForms/MainForm.cs +++ b/src/MpvNet.Windows/WinForms/MainForm.cs @@ -221,17 +221,17 @@ void GuiCommand_MoveWindow(string direction) Left = workingArea.Left; break; case "top": - Top = 0; + Top = workingArea.Top; break; case "right": Left = workingArea.Width - Width + workingArea.Left; break; case "bottom": - Top = workingArea.Height - Height; + Top = workingArea.Bottom - Height; break; case "center": - Left = (screen.Bounds.Width - Width) / 2; - Top = (screen.Bounds.Height - Height) / 2; + Left = workingArea.Left + (workingArea.Width - Width) / 2; + Top = workingArea.Top + (workingArea.Height - Height) / 2; break; } });