Created
October 30, 2024 18:32
-
-
Save dkandalov/d326df86849a2a097d169b781ffbc0a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.wm.impl.ProjectFrameHelper | |
import com.intellij.openapi.wm.impl.status.InfoAndProgressPanel | |
import liveplugin.getProperty | |
import liveplugin.invoke | |
import liveplugin.registerAction | |
import java.awt.KeyboardFocusManager | |
// https://youtrack.jetbrains.com/issue/IDEA-216058/Return-focus-from-Background-Tasks-window-to-IDE-via-keyboard | |
registerAction("Show Background Process Window", keyStroke = "meta shift B") { | |
val window = KeyboardFocusManager.getCurrentKeyboardFocusManager().focusedWindow | |
val statusBar = ProjectFrameHelper.getFrameHelper(window)?.statusBar ?: return@registerAction | |
val panel = statusBar.getProperty<InfoAndProgressPanel>("infoAndProgressPanel") | |
if (statusBar.isProcessWindowOpen) { | |
panel.invoke("hideProcessPopup") | |
} else { | |
panel.invoke("openProcessPopup", /*requestFocus*/ false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment