Quantcast
Channel: Total Commander
Viewing all articles
Browse latest Browse all 3829

TC11.x bug reports (English) • TC windows jump on RDP reconnect

$
0
0
TC 11.03 64 bit , on Windows 10 x64, both client and server side.
When I reconnect to my remote session, Total Commander windows on non-primary monitors tend to jump and change size.

To be more specific, here's an experiment:
  1. I have 3 monitors connected to my local system. The monitor2 is in the center, this is the Windows "main monitor", and there's the Windows Taskbar on it.
  2. I connect to a remote system with the standard Windows RDP.
  3. Just in case, I open 1 TC instance, position it in the lower-half of the monitor1 (using the AHK script below)(this could be reproduced manually, but the pixel-perfect positioning is painful). I click "Configuration->Save Position" close TC and then reopen to make sure it remembers the position. Then I close this TC.
  4. I open 6 TC instances, position them like this:
    1. upper-half of the monitor1
    2. lower-half of the monitor1
    3. upper-half of the monitor2
    4. lower-half of the monitor2
    5. upper-half of the monitor3
    6. lower-half of the monitor3
  5. I close my RDP session window
  6. Almost immediately, I reconnect to the same RDP session (nothing changed in the local monitor config)
  7. As a result:
    1. remains almost in place, but shrinks a bit - now there are small gaps in between the window and the monitor edges
    2. jumps to the upper half of the monitor1, exactly the same position as the previous window
    3. everything looks OK - the window is exactly where it was
    4. everything looks OK - the window is exactly where it was
    5. remains almost in place, but shrinks a bit - now there are small gaps in between the window and the monitor edges
    6. jumps to the upper half of the monitor3, exactly the same position as the previous window
  8. I tried few other scenarios.. But the behavior seem to be erratic and not always reproducible. I'm not really sure why. Maybe I'm missing something.
  9. I try to reproduce the same with "notepad.exe" windows, but they keep their positions perfectly.
I found File name column width on RDP reconnect thread and tried to use Spy++ to catch the WM_DISPLAYCHANGE on RDP reconnect. Although there are ~170 lines in that log after the relogin, there's no WM_DISPLAYCHANGE in there.

My monitor config is as follows:

Code:

PS C:\temp> Add-Type -AssemblyName System.Windows.FormsPS C:\temp> [System.Windows.Forms.Screen]::AllScreensBitsPerPixel : 32Bounds       : {X=0,Y=0,Width=3840,Height=2160}DeviceName   : \\.\DISPLAY5Primary      : TrueWorkingArea  : {X=0,Y=0,Width=3778,Height=2160}BitsPerPixel : 32Bounds       : {X=-1200,Y=0,Width=1200,Height=1920}DeviceName   : \\.\DISPLAY7Primary      : FalseWorkingArea  : {X=-1200,Y=0,Width=1200,Height=1920}BitsPerPixel : 32Bounds       : {X=3840,Y=0,Width=1200,Height=1920}DeviceName   : \\.\DISPLAY6Primary      : FalseWorkingArea  : {X=3840,Y=0,Width=1200,Height=1920}
The AHK script:

Code:

UpDownSnap(Direction){  ; WinMaximize("A")  WinGetPos(&x, &y, &w, &h, "a", , ,)  monitorCount := MonitorGetCount()  refArea := 0  Loop monitorCount  {    MonitorGetWorkArea(A_Index, &mLeft, &mTop, &mRight, &mBottom)xo := Max(0, Min(x + w, mRight) - Max(x, mLeft))yo := Max(0, Min(y + h, mBottom) - Max(y, mTop))    ; SysGet, m, MonitorWorkArea, %A_Index%    ;xo := Max(0, Min(x + w, mRight) - Max(x, mLeft))    ;yo := Max(0, Min(y + h, mBottom) - Max(y, mTop))    area := xo * yo    if (area > refArea)    {      monTop := mTop      monBottom := mBottom      monLeft := mLeft      monRight := mRight      refArea := area    }  }  ; If the refArea is still equal to 0, the window does  ; not overlap with any monitors. Wat?  if (refArea > 0)  {  ; Need some "boder width" to compensate for invisible window boders, for all sides except top; https://autohotkey.com/boards/viewtopic.php?p=87378#p87378bw := 7        if (direction = 1)      newY := monTop    Else      newY := (monBottom - monTop) / 2 + monTop      WinMove(monLeft-bw, newY, (monRight - monLeft)+bw*2, (monBottom - monTop) / 2 + bw, "a"); Log("Moving to x=" monLeft); Log("Moving to monTop=" monTop)  }}^#Up::UpDownSnap(1)^#Down::UpDownSnap(0)

Statistics: Posted by igor3v — 2024-09-07, 20:07 UTC



Viewing all articles
Browse latest Browse all 3829

Trending Articles