Focus back to Intellij Ide

Answered

I am trying to implement PKCE auth for a plugin feature and making use of the BuiltInServer to do the redirect back to the IDE from the browser after the auth. 

However, I am not able to focus the IDE which initiated the PKCE auth and bring it to front.

I explored IdeFocusManager class and used below code. However, after this line is executed no other window is opening.

IdeFocusManagerImpl.getInstance(project).getLastFocusedIdeWindow().setAlwaysOnTop(true);

Whats the best way to do this?

Can anyone please help!

1 comment
Comment actions Permalink

Are you executing focus code on EDT? As you already have relevant Project, see also com.intellij.openapi.wm.WindowManager

0

Please sign in to leave a comment.