public Point getLocationOn(JComponent c) {
    Point location;
    if (isRealPopup()) {
      location = myPopup.getLocationOnScreen();
      SwingUtilities.convertPointFromScreen(location, c);
    } else {
      if (myCurrentIdeTooltip != null) {
        Point tipPoint = myCurrentIdeTooltip.getPoint();
        Component tipComponent = myCurrentIdeTooltip.getComponent();
        return SwingUtilities.convertPoint(tipComponent, tipPoint, c);
      } else {
        location =
            SwingUtilities.convertPoint(myComponent.getParent(), myComponent.getLocation(), c);
      }
    }

    return location;
  }