changeset 54157:ac04efe9feed

8214765: All TrayIcon MessageType icons does not show up with gtk3 option set Reviewed-by: serb, psadhukhan
author pbansal
date Fri, 18 Jan 2019 13:54:32 +0530
parents 6dae74bb8a43
children 420d0198e26a
files src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java
diffstat 1 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java	Fri Jan 18 13:36:16 2019 +0530
+++ b/src/java.desktop/unix/classes/sun/awt/X11/InfoWindow.java	Fri Jan 18 13:54:32 2019 +0530
@@ -53,6 +53,7 @@
 import java.util.concurrent.ArrayBlockingQueue;
 
 import sun.awt.SunToolkit;
+import sun.awt.UNIXToolkit;
 
 /**
  * An utility window class. This is a base class for Tooltip and Balloon.
@@ -437,12 +438,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;
             }
         }