Skip to content

Commit

Permalink
Merge pull request #327 from BAndysc/windows_host_drag
Browse files Browse the repository at this point in the history
Fix host windows dragging on Windows
  • Loading branch information
wieslawsoltes authored Mar 11, 2024
2 parents ca77bde + f419c77 commit 331661c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Dock.Avalonia/Controls/HostWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ private void MoveDrag(PointerPressedEventArgs e)
PseudoClasses.Set(":dragging", true);
_draggingWindow = true;
BeginMoveDrag(e);

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
EndDrag(e);
}
}

private void EndDrag(PointerEventArgs e)
Expand Down Expand Up @@ -150,9 +145,7 @@ private void HostWindow_PositionChanged(object? sender, PixelPointEventArgs e)
{
Window.Save();

if ((_chromeGrip is { } && _chromeGrip.IsPointerOver)
|| (_hostWindowTitleBar?.BackgroundControl is { } && (_hostWindowTitleBar?.BackgroundControl?.IsPointerOver ?? false))
&& _mouseDown)
if (_mouseDown)
{
Window.Factory?.OnWindowMoveDrag(Window);
_hostWindowState.Process(Position.ToPoint(1.0), EventType.Moved);
Expand Down

0 comments on commit 331661c

Please sign in to comment.