Skip to content

Commit

Permalink
Merge pull request #367 from Muhahe/master
Browse files Browse the repository at this point in the history
Fix for #306 StartDraggingFloatingWindow
  • Loading branch information
Dirkster99 authored Jul 16, 2022
2 parents cf19e64 + 689e458 commit 518512b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
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

0 comments on commit 518512b

Please # to comment.