private static boolean almostEquals(@NotNull Rectangle r1, @NotNull Rectangle r2) {
    int tolerance = Registry.intValue("ide.dialog.maximize.tolerance", 10);
    return abs(r1.x - r2.x) <= tolerance && abs(r1.y - r2.y) <= tolerance && abs(r1.width - r2.width) <= tolerance && abs(r1.height - r2.height) <= tolerance;
  }
private static boolean almostEquals(@NotNull Rectangle r1, @NotNull Rectangle r2)