Skip to content

Commit 17ba1f1

Browse files
chore: bring game to foreground after pkce flow (#3690)
1 parent b45323b commit 17ba1f1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Source/Immutable/Private/Immutable/Windows/ImmutablePKCEWindows.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,20 @@ void UImmutablePKCEWindows::HandleDeepLink(UImmutablePKCEData* PKCEData, const F
480480
if (CleanDeepLink.StartsWith(PKCEData->PassportInitData.redirectUri) || CleanDeepLink.StartsWith(PKCEData->PassportInitData.logoutRedirectUri))
481481
{
482482
PKCEData->DynamicMulticastDelegate_DeepLinkCallback.Broadcast(CleanDeepLink);
483+
484+
// After PKCE authentication completes, return focus to the game window
485+
if (GEngine && GEngine->GameViewport && GEngine->GameViewport->GetWindow().IsValid())
486+
{
487+
TSharedPtr<SWindow> GameWindow = GEngine->GameViewport->GetWindow();
488+
GameWindow->BringToFront();
489+
GameWindow->HACK_ForceToFront();
490+
491+
IMTBL_LOG("Game window brought to foreground after authentication completed");
492+
}
493+
else
494+
{
495+
IMTBL_WARN("Could not bring game window to foreground: window is not valid");
496+
}
483497
}
484498
else
485499
{

0 commit comments

Comments
 (0)