changeset 50842:4d990bb19c99

4475138: getBestCursorSize and XFree86 4.1.0 Reviewed-by: serb Contributed-by: takiguc@linux.vnet.ibm.com
author serb
date Mon, 25 Jun 2018 17:34:55 -0700
parents 1a9ebf66fd9f
children f8c8bfd59e05
files src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java	Mon Jun 25 14:56:07 2018 -0700
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java	Mon Jun 25 17:34:55 2018 -0700
@@ -63,6 +63,10 @@
 
             XlibWrapper.XQueryBestCursor(display,root_window, Math.abs(preferredWidth),Math.abs(preferredHeight),XlibWrapper.larg1,XlibWrapper.larg2);
             d = new Dimension(XlibWrapper.unsafe.getInt(XlibWrapper.larg1),XlibWrapper.unsafe.getInt(XlibWrapper.larg2));
+            if (preferredWidth > 0 && preferredHeight > 0) {
+                d.width = Math.min(d.width, preferredWidth);
+                d.height = Math.min(d.height, preferredHeight);
+            }
         }
         finally {
             XToolkit.awtUnlock();