Skip to content

fix: move-window top/bottom/center ignore working area offset#778

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/mp-winui-move-window
Open

fix: move-window top/bottom/center ignore working area offset#778
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/mp-winui-move-window

Conversation

@Noethix55555

Copy link
Copy Markdown

GuiCommand_MoveWindow snaps windows to screen edges using the working area, but top, bottom, and center all ignore the working area's position offset.

  • top sets Top = 0 (raw screen y=0) instead of workingArea.Top
  • bottom sets Top = workingArea.Height - Height instead of workingArea.Bottom - Height
  • center uses screen.Bounds instead of workingArea, so it can center under the taskbar

left and right correctly add workingArea.Left, so top and bottom are inconsistent. On the primary monitor with a bottom taskbar the error equals the taskbar height; on a non-primary monitor or with a top taskbar the window is placed off-screen.

Fix: use workingArea.Top / workingArea.Bottom / workingArea consistently for all four directions and for center.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant