Skip to content

Commit 7da0fa4

Browse files
chore: bring game to foreground after pkce flow (#3690)
1 parent e143ab4 commit 7da0fa4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

+14
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,20 @@ void UImmutablePKCEWindows::HandleDeepLink(UImmutablePKCEData* PKCEData, const F
503503
if (CleanDeepLink.StartsWith(PKCEData->PassportInitData.redirectUri) || CleanDeepLink.StartsWith(PKCEData->PassportInitData.logoutRedirectUri))
504504
{
505505
PKCEData->DynamicMulticastDelegate_DeepLinkCallback.Broadcast(CleanDeepLink);
506+
507+
// After PKCE authentication completes, return focus to the game window
508+
if (GEngine && GEngine->GameViewport && GEngine->GameViewport->GetWindow().IsValid())
509+
{
510+
TSharedPtr<SWindow> GameWindow = GEngine->GameViewport->GetWindow();
511+
GameWindow->BringToFront();
512+
GameWindow->HACK_ForceToFront();
513+
514+
IMTBL_LOG("Game window brought to foreground after authentication completed");
515+
}
516+
else
517+
{
518+
IMTBL_WARN("Could not bring game window to foreground: window is not valid");
519+
}
506520
}
507521
else
508522
{

0 commit comments

Comments
 (0)