Skip to content

Commit 27b3ad1

Browse files
committed
Fix the virtual machine content resize issue after the virtual machine resolution changed in the basic session when the host display uses High DPI and the virtual machine window is maximized. (#24) (Feedbacked by dongle-the-gadget.)
1 parent 55f965a commit 27b3ad1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

NanaBox/MainWindow.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,13 +1009,19 @@ void NanaBox::MainWindow::RdpClientOnRemoteDesktopSizeChange(
10091009
{
10101010
if (this->m_RdpClientMode == RdpClientMode::BasicSession)
10111011
{
1012+
this->m_DisplayResolution = CSize(Width, Height);
1013+
10121014
if (this->IsZoomed())
10131015
{
1016+
VARIANT RawZoomLevel;
1017+
RawZoomLevel.vt = VT_UI4;
1018+
RawZoomLevel.uintVal = this->m_RecommendedZoomLevel;
1019+
this->m_RdpClient->Property(
1020+
L"ZoomLevel",
1021+
RawZoomLevel);
10141022
return;
10151023
}
10161024

1017-
this->m_DisplayResolution = CSize(Width, Height);
1018-
10191025
UINT DpiValue = ::GetDpiForWindow(this->m_hWnd);
10201026

10211027
RECT WindowRect;

0 commit comments

Comments
 (0)