Skip to content

Commit 4fe7f34

Browse files
committedMar 6, 2018
Raw cursor position should be DPI-adjusted before being used by WPF to position the restored window.
Address issue 196
1 parent 61b1524 commit 4fe7f34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎Dragablz/DragablzWindow.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,10 @@ private void WindowMoveThumbOnDragDelta(object sender, DragDeltaEventArgs dragDe
335335
var cursorPos = Native.GetRawCursorPos();
336336
WindowState = WindowState.Normal;
337337

338-
Top = cursorPos.Y - 2;
339-
Left = cursorPos.X - RestoreBounds.Width / 2;
338+
GetDPI();
339+
340+
Top = cursorPos.Y / _yScale - 2;
341+
Left = cursorPos.X / _xScale - RestoreBounds.Width / 2;
340342

341343
var lParam = (int)(uint)cursorPos.X | (cursorPos.Y << 16);
342344
Native.SendMessage(CriticalHandle, WindowMessage.WM_LBUTTONUP, (IntPtr)HitTest.HT_CAPTION,

0 commit comments

Comments
 (0)
Please sign in to comment.