From 2f65bc73f4fe5133c37af1cfc39dbb55bd5bbf0d Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Wed, 14 May 2014 18:24:14 -0400 Subject: [PATCH] Fix window getting put in an odd place if moved outside of size/move --- Windows/SnappingWindow.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Windows/SnappingWindow.cs b/Windows/SnappingWindow.cs index 7ac8b52..08e558f 100644 --- a/Windows/SnappingWindow.cs +++ b/Windows/SnappingWindow.cs @@ -16,6 +16,7 @@ namespace Common.Wpf.Windows #region Member variables private HwndSource _hwndSource; + private bool _inSizeMove; private Structures.WindowPosition _lastWindowPosition; private List _otherWindows; @@ -145,9 +146,13 @@ namespace Common.Wpf.Windows // Store the current other windows _otherWindows = OtherWindows; + _inSizeMove = true; + break; case (int) Constants.WindowMessage.ExitSizeMove: + _inSizeMove = false; + break; } @@ -160,6 +165,9 @@ namespace Common.Wpf.Windows private IntPtr OnWindowPositionChanging(IntPtr lParam, ref bool handled) { + if (!_inSizeMove) + return IntPtr.Zero; + int snapDistance = SnapDistance; // Initialize whether we've updated the position