Skip to content

Commit 6fbc454

Browse files
committed
Windows: Fix blank window in RDP sessions
Clear the window display affinity before showing the warning dialog so the window is visible during the dialog's nested event loop. Fixes #3621 Assisted-by: Claude (Anthropic)
1 parent ef6e5db commit 6fbc454

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/platform/win/winplatform.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ bool WinPlatform::setPreventScreenCapture(WId winId, bool prevent)
298298
// Remote desktop clients are screen capture systems — applying
299299
// WDA_EXCLUDEFROMCAPTURE makes windows invisible to the remote viewer.
300300
if (prevent && GetSystemMetrics(SM_REMOTESESSION)) {
301+
if (!SetWindowDisplayAffinity(window, WDA_NONE))
302+
log("Failed to clear display affinity in remote session", LogWarning);
303+
301304
static bool logged = false;
302305
if (!logged) {
303306
logged = true;
@@ -317,7 +320,6 @@ bool WinPlatform::setPreventScreenCapture(WId winId, bool prevent)
317320
}
318321
}
319322

320-
SetWindowDisplayAffinity(window, WDA_NONE);
321323
return false;
322324
}
323325

0 commit comments

Comments
 (0)