changeset 13557:7811cb0f443e

8214765: All TrayIcon MessageType icons does not show up with gtk3 option set Reviewed-by: serb, psadhukhan, clanger
author stooke
date Mon, 03 Jun 2019 16:39:07 +0100
parents ec41773b9ff2
children 9a6d73d0b95c
files src/solaris/classes/sun/awt/X11/InfoWindow.java
diffstat 1 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/InfoWindow.java	Mon Jun 03 15:58:44 2019 +0100
+++ b/src/solaris/classes/sun/awt/X11/InfoWindow.java	Mon Jun 03 16:39:07 2019 +0100
@@ -414,12 +414,24 @@
 
         private void loadGtkImages() {
             if (!gtkImagesLoaded) {
-                errorImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-error.6.rtl");
-                warnImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-warning.6.rtl");
-                infoImage = (Image)Toolkit.getDefaultToolkit().getDesktopProperty(
-                    "gtk.icon.gtk-dialog-info.6.rtl");
+                //check whether the gtk version is >= 3.10 as the Icon names were
+                //changed from this release
+                UNIXToolkit tk = (UNIXToolkit) Toolkit.getDefaultToolkit();
+                if (tk.checkGtkVersion(3, 10, 0)) {
+                    errorImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-error.6.rtl");
+                    warnImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-warning.6.rtl");
+                    infoImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.dialog-information.6.rtl");
+                } else {
+                    errorImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-error.6.rtl");
+                    warnImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-warning.6.rtl");
+                    infoImage = (Image) tk.getDesktopProperty(
+                            "gtk.icon.gtk-dialog-info.6.rtl");
+                }
                 gtkImagesLoaded = true;
             }
         }
@@ -492,4 +504,3 @@
         }
     }
 }
-