From b3e56c95ef596a60401b2565115bc42c88470ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 12 Jun 2025 22:41:41 +0200 Subject: [PATCH] [WINLOGON] WlxSwitchDesktopToUser/Winlogon(): ensure the calling thread is assigned the specified desktop (#8130) Invoke SetThreadDesktop() after a successful SwitchDesktop() call. --- base/system/winlogon/wlx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/base/system/winlogon/wlx.c b/base/system/winlogon/wlx.c index edcdd6d91be..3a27b051986 100644 --- a/base/system/winlogon/wlx.c +++ b/base/system/winlogon/wlx.c @@ -411,10 +411,14 @@ WlxSwitchDesktopToUser( HANDLE hWlx) { PWLSESSION Session = (PWLSESSION)hWlx; + BOOL bRet; TRACE("WlxSwitchDesktopToUser()\n"); - return (int)SwitchDesktop(Session->ApplicationDesktop); + bRet = SwitchDesktop(Session->ApplicationDesktop); + if (bRet) + SetThreadDesktop(Session->ApplicationDesktop); + return (int)bRet; } /* @@ -426,10 +430,14 @@ WlxSwitchDesktopToWinlogon( HANDLE hWlx) { PWLSESSION Session = (PWLSESSION)hWlx; + BOOL bRet; TRACE("WlxSwitchDesktopToWinlogon()\n"); - return (int)SwitchDesktop(Session->WinlogonDesktop); + bRet = SwitchDesktop(Session->WinlogonDesktop); + if (bRet) + SetThreadDesktop(Session->WinlogonDesktop); + return (int)bRet; } /*