mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-278414 A tool in View Mode Window is instantly getting closed
GitOrigin-RevId: dab7589ea5bd812d4f4dc6a1db2090f339582bed
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8e72fb8593
commit
5b0200db5c
@@ -113,7 +113,7 @@ open class FrameWrapper @JvmOverloads constructor(project: Project?,
|
||||
val focusListener = object : WindowAdapter() {
|
||||
override fun windowOpened(e: WindowEvent) {
|
||||
val focusManager = IdeFocusManager.getInstance(project)
|
||||
val toFocus = preferredFocusedComponent ?: focusManager.getFocusTargetFor(component!!)
|
||||
val toFocus = focusManager.getLastFocusedFor(e.window) ?: preferredFocusedComponent ?: focusManager.getFocusTargetFor(component!!)
|
||||
if (toFocus != null) {
|
||||
focusManager.requestFocus(toFocus, true)
|
||||
}
|
||||
|
||||
@@ -2289,7 +2289,7 @@ enum class ToolWindowProperty {
|
||||
|
||||
private fun isInActiveToolWindow(component: Any?, activeToolWindow: ToolWindowImpl): Boolean {
|
||||
var source = if (component is JComponent) component else null
|
||||
val activeToolWindowComponent = activeToolWindow.getComponentIfInitialized()
|
||||
val activeToolWindowComponent = activeToolWindow.decoratorComponent
|
||||
if (activeToolWindowComponent != null) {
|
||||
while (source != null && source !== activeToolWindowComponent) {
|
||||
source = ComponentUtil.getClientProperty(source, ToolWindowManagerImpl.PARENT_COMPONENT) ?: source.parent as? JComponent
|
||||
|
||||
Reference in New Issue
Block a user