4475138: getBestCursorSize and XFree86 4.1.0
authorserb
Mon, 25 Jun 2018 17:34:55 -0700
changeset 50842 4d990bb19c99
parent 50841 1a9ebf66fd9f
child 50843 f8c8bfd59e05
4475138: getBestCursorSize and XFree86 4.1.0 Reviewed-by: serb Contributed-by: takiguc@linux.vnet.ibm.com
src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java
--- 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();