mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-148849 Windowed toolwindows do not preserve size on restart
This commit is contained in:
@@ -2221,8 +2221,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
|
||||
|
||||
Window frame = myWindowedDecorator.getFrame();
|
||||
if (!frame.isShowing()) return;
|
||||
Rectangle bounds = frame.getBounds();
|
||||
bounds.setLocation(frame.getLocationOnScreen());
|
||||
Rectangle bounds = getRootBounds((JFrame)frame);
|
||||
info.setFloatingBounds(bounds);
|
||||
}
|
||||
|
||||
@@ -2243,6 +2242,14 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Rectangle getRootBounds(JFrame frame) {
|
||||
JRootPane rootPane = frame.getRootPane();
|
||||
Rectangle bounds = rootPane.getBounds();
|
||||
bounds.setLocation(frame.getX() + rootPane.getX(), frame.getY() + rootPane.getY());
|
||||
return bounds;
|
||||
}
|
||||
|
||||
private final class EditorComponentFocusWatcher extends FocusWatcher {
|
||||
@Override
|
||||
protected void focusedComponentChanged(final Component component, final AWTEvent cause) {
|
||||
@@ -2383,6 +2390,12 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
|
||||
info.setFloatingBounds(owner.getBounds());
|
||||
}
|
||||
}
|
||||
else if (info.isWindowed()) {
|
||||
WindowedDecorator decorator = getWindowedDecorator(info.getId());
|
||||
Window frame = decorator != null ? decorator.getFrame() : null;
|
||||
if (frame == null || !frame.isShowing()) return;
|
||||
info.setFloatingBounds(getRootBounds((JFrame)frame));
|
||||
}
|
||||
else { // docked and sliding windows
|
||||
ToolWindowAnchor anchor = info.getAnchor();
|
||||
if (source.getParent() instanceof Splitter) {
|
||||
|
||||
Reference in New Issue
Block a user