[10.0.1] Toolwindow title bar paiting fix (active/inactive)

This commit is contained in:
Kirill Kalishev
2010-12-13 19:13:53 +03:00
parent 0bf6b20d50
commit cee2d1283a
2 changed files with 6 additions and 3 deletions
@@ -114,7 +114,8 @@ public class FocusManagerImpl extends IdeFocusManager implements Disposable {
final Component c = fe.getComponent();
if (c instanceof Window || c == null) return false;
Component parent = UIUtil.findUltimateParent(c);
Component parent = SwingUtilities.getWindowAncestor(c);
if (parent instanceof IdeFrame) {
myLastFocused.put((IdeFrame)parent, new WeakReference<Component>(c));
}
@@ -176,10 +176,12 @@ public final class InternalDecorator extends JPanel implements Queryable, TypeSa
}
public boolean isFocused() {
Component component = IdeFocusManager.getInstance(myProject).getFocusedDescendantFor(myToolWindow.getComponent());
IdeFocusManager fm = IdeFocusManager.getInstance(myProject);
Component component = fm.getFocusedDescendantFor(myToolWindow.getComponent());
if (component != null) return true;
Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
Component owner = fm.getLastFocusedFor(WindowManager.getInstance().getIdeFrame(myProject));
return owner != null && SwingUtilities.isDescendingFrom(owner, myToolWindow.getComponent());
}