Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for #306 StartDraggingFloatingWindow #367

Merged
merged 2 commits into from
Jul 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected virtual void OnModelChanged(DependencyPropertyChangedEventArgs e)
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
CaptureMouse();
_allowDrag = false;
Model.IsActive = true;
if (Model is LayoutDocument layoutDocument && !layoutDocument.CanMove) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ internal void AttachDrag(bool onActivated = true)
}
else
{
CaptureMouse();
var windowHandle = new WindowInteropHelper(this).Handle;
var lParam = new IntPtr(((int)Left & 0xFFFF) | ((int)Top << 16));
Win32Helper.SendMessage(windowHandle, Win32Helper.WM_NCLBUTTONDOWN, new IntPtr(Win32Helper.HT_CAPTION), lParam);
Expand Down