Browse Source

Bug 1497: Moving Login dialog moves main window disproportionally on some systems (2nd try)

2nd try - Moving Login window left of the desktop edge reintroduced the problem

https://winscp.net/tracker/1497
(cherry picked from commit afb87930284b0918f95543ff5bb1daf0041c46ee)

Source commit: c6e4283727991de15c927fc24b31b9083464307f
Martin Prikryl 8 years ago
parent
commit
7a3a161797
1 changed files with 3 additions and 2 deletions
  1. 3 2
      source/forms/Login.cpp

+ 3 - 2
source/forms/Login.cpp

@@ -10,6 +10,7 @@
 #include <TextsCore.h>
 #include <HelpWin.h>
 #include <VCLCommon.h>
+#include <limits>
 
 #include "WinInterface.h"
 #include "Login.h"
@@ -72,7 +73,7 @@ __fastcall TLoginDialog::TLoginDialog(TComponent* AOwner)
   FSortEnablePending = false;
   FSiteSearch = ssSiteName;
   FLinkedForm = NULL;
-  FPrevPos = TPoint(-1, -1);
+  FPrevPos = TPoint(std::numeric_limits<LONG>::min(), std::numeric_limits<LONG>::min());
 
   // we need to make sure that window procedure is set asap
   // (so that CM_SHOWINGCHANGED handling is applied)
@@ -1541,7 +1542,7 @@ void __fastcall TLoginDialog::WMMoving(TMessage & Message)
 
   if (FLinkedForm != NULL)
   {
-    if (FPrevPos.X < 0)
+    if (FPrevPos.X == std::numeric_limits<LONG>::min())
     {
       FPrevPos = BoundsRect.TopLeft();
     }