mirror of
https://github.com/ckaczor/Common.Wpf.git
synced 2026-01-14 01:25:37 -05:00
Fix window getting put in an odd place if moved outside of size/move
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Common.Wpf.Windows
|
|||||||
#region Member variables
|
#region Member variables
|
||||||
|
|
||||||
private HwndSource _hwndSource;
|
private HwndSource _hwndSource;
|
||||||
|
private bool _inSizeMove;
|
||||||
private Structures.WindowPosition _lastWindowPosition;
|
private Structures.WindowPosition _lastWindowPosition;
|
||||||
private List<WindowInformation> _otherWindows;
|
private List<WindowInformation> _otherWindows;
|
||||||
|
|
||||||
@@ -145,9 +146,13 @@ namespace Common.Wpf.Windows
|
|||||||
// Store the current other windows
|
// Store the current other windows
|
||||||
_otherWindows = OtherWindows;
|
_otherWindows = OtherWindows;
|
||||||
|
|
||||||
|
_inSizeMove = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (int) Constants.WindowMessage.ExitSizeMove:
|
case (int) Constants.WindowMessage.ExitSizeMove:
|
||||||
|
_inSizeMove = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,6 +165,9 @@ namespace Common.Wpf.Windows
|
|||||||
|
|
||||||
private IntPtr OnWindowPositionChanging(IntPtr lParam, ref bool handled)
|
private IntPtr OnWindowPositionChanging(IntPtr lParam, ref bool handled)
|
||||||
{
|
{
|
||||||
|
if (!_inSizeMove)
|
||||||
|
return IntPtr.Zero;
|
||||||
|
|
||||||
int snapDistance = SnapDistance;
|
int snapDistance = SnapDistance;
|
||||||
|
|
||||||
// Initialize whether we've updated the position
|
// Initialize whether we've updated the position
|
||||||
|
|||||||
Reference in New Issue
Block a user