8230869: [macos 10.15] The String "X Y Z" was not set to application's icon in the taskbar
authorserb
Thu, 17 Oct 2019 14:07:02 -0700
changeset 59169 7dae4286f1cc
parent 59168 8612b8012718
child 59170 945f5bfab0f7
8230869: [macos 10.15] The String "X Y Z" was not set to application's icon in the taskbar Reviewed-by: jdv, psadhukhan
src/java.desktop/macosx/classes/apple/laf/JRSUIUtils.java
src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java
--- a/src/java.desktop/macosx/classes/apple/laf/JRSUIUtils.java	Wed Oct 16 22:30:30 2019 +0100
+++ b/src/java.desktop/macosx/classes/apple/laf/JRSUIUtils.java	Thu Oct 17 14:07:02 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,11 @@
 
     static boolean isLeopard = isMacOSXLeopard();
     static boolean isSnowLeopardOrBelow = isMacOSXSnowLeopardOrBelow();
+    static boolean isCatalinaOrAbove = isMacOSXCatalinaOrAbove();
+
+    static boolean isMacOSXCatalinaOrAbove() {
+        return currentMacOSXVersionMatchesGivenVersionRange(15, true, false, true);
+    }
 
     static boolean isMacOSXLeopard() {
         return isCurrentMacOSXVersion(5);
@@ -74,6 +79,12 @@
         return false;
     }
 
+    public static class TaskBar {
+        public static boolean isIconBadgeSupported() {
+            return !isCatalinaOrAbove;
+        }
+    }
+
     public static class TabbedPane {
         public static boolean useLegacyTabs() {
             return isLeopard;
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java	Wed Oct 16 22:30:30 2019 +0100
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTaskbarPeer.java	Thu Oct 17 14:07:02 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,12 +25,14 @@
 
 package sun.lwawt.macosx;
 
-import com.apple.eawt.Application;
 import java.awt.Image;
 import java.awt.PopupMenu;
 import java.awt.Taskbar.Feature;
 import java.awt.peer.TaskbarPeer;
 
+import apple.laf.JRSUIUtils;
+import com.apple.eawt.Application;
+
 final public class CTaskbarPeer implements TaskbarPeer {
 
     CTaskbarPeer() {}
@@ -40,6 +42,7 @@
         switch(feature) {
             case ICON_BADGE_TEXT:
             case ICON_BADGE_NUMBER:
+                return JRSUIUtils.TaskBar.isIconBadgeSupported();
             case ICON_IMAGE:
             case MENU:
             case PROGRESS_VALUE: