Changeset 17681 in josm


Ignore:
Timestamp:
2021-03-28T17:17:15+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #19585 - add workaround to JDK-8262085

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r17679 r17681  
    10471047
    10481048    static void applyWorkarounds() {
     1049        final String laf = UIManager.getLookAndFeel().getID();
     1050        final int javaVersion = Utils.getJavaVersion();
    10491051        // Workaround for JDK-8180379: crash on Windows 10 1703 with Windows L&F and java < 8u141 / 9+172
    10501052        // To remove during Java 9 migration
     
    10551057                if (build != null) {
    10561058                    final int currentBuild = Integer.parseInt(build);
    1057                     final int javaVersion = Utils.getJavaVersion();
    10581059                    final int javaUpdate = Utils.getJavaUpdate();
    10591060                    final int javaBuild = Utils.getJavaBuild();
     
    10701071                Logging.log(Logging.LEVEL_ERROR, null, e);
    10711072            }
    1072         } else if (PlatformManager.isPlatformOsx() && Utils.getJavaVersion() < 16) {
     1073        } else if (PlatformManager.isPlatformOsx() && javaVersion < 16) {
    10731074            // Workaround for JDK-8251377: JTabPanel active tab is unreadable in Big Sur, see #20075
    10741075            // os.version will return 10.16, or 11.0 depending on environment variable
    10751076            // https://twitter.com/BriceDutheil/status/1330926649269956612
    1076             final String laf = UIManager.getLookAndFeel().getID();
    10771077            final String macOSVersion = getSystemProperty("os.version");
    10781078            if ((laf.contains("Mac") || laf.contains("Aqua"))
     
    10801080                UIManager.put("TabbedPane.foreground", Color.BLACK);
    10811081            }
     1082        }
     1083        // Workaround for JDK-8262085
     1084        if ("Metal".equals(laf) && javaVersion >= 11 && javaVersion < 17) {
     1085            UIManager.put("ToolTipUI", JosmMetalToolTipUI.class.getCanonicalName());
    10821086        }
    10831087    }
Note: See TracChangeset for help on using the changeset viewer.