reliably restore full-screen rdp window

This commit is contained in:
Kang Yu 2025-02-02 16:00:53 -08:00
parent 2bfd021698
commit b70db0aa53

View file

@ -1173,6 +1173,10 @@ namespace PersistentWindows.Common
bool isFullScreen = false; bool isFullScreen = false;
if ((style & (long)WindowStyleFlags.MAXIMIZEBOX) == 0L) if ((style & (long)WindowStyleFlags.MAXIMIZEBOX) == 0L)
{ {
// mstsc in full-screen mode may report inaccurate size such as 3858 x 2207 on 4k monitor
if (windowProcessName.ContainsKey(hwnd) && windowProcessName[hwnd] == "mstsc")
return true;
RECT screenPosition = new RECT(); RECT screenPosition = new RECT();
User32.GetWindowRect(hwnd, ref screenPosition); User32.GetWindowRect(hwnd, ref screenPosition);