OnSize only refreshed the cached client rect, letterbox offsets and zoom
factors; it never asked for a repaint. Windows invalidates a window only
when the client area grows, so restoring a maximized viewer marks nothing
invalid. Since the dialog stops erasing its background after the first
frame and has no periodic repaint timer, the sole remaining repaint source
is a change on the remote screen. A static remote desktop therefore kept
the maximized picture - cropped, not following the window - until something
moved on the far end.
Call InvalidateRect(NULL, FALSE) at the end of OnSize whenever the client
area is non-empty, so every size change (restore, fullscreen transitions
and interactive resizing) recomputes the layout and repaints once. It is a
no-op while the window is hidden; CHideScreenSpyDlg::OnSize calls the base
handler, so it inherits the same behaviour.
Verified on a Debug build against a live test client: the maximized client
(1920x1009) renders 63/64 px side bars and the restored one (717x355) 43/43
px, matching ComputeAdaptiveLayout (renderW=631, offsetX=43).
Co-Authored-By: deepseek-flash