private static void fitXToComponentScreen(@NotNull Point screenPoint, @NotNull Component comp) {
    var componentScreen = ScreenUtil.getScreenRectangle(comp);
    if (screenPoint.x < componentScreen.x) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Moving the popup X coordinate from " + screenPoint.x + " to " + componentScreen.x + " to fit into the component screen " + componentScreen);
      }
      screenPoint.x = componentScreen.x;
    }
    if (screenPoint.x > componentScreen.x + componentScreen.width) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Moving the popup X coordinate from " + screenPoint.x + " to " + (componentScreen.x + componentScreen.width) + " to fit into the component screen " + componentScreen);
      }
      screenPoint.x = componentScreen.x + componentScreen.width;
    }
  }
private static void fitXToComponentScreen(@NotNull Point screenPoint, @NotNull Component comp)