4475138: getBestCursorSize and XFree86 4.1.0
Reviewed-by: serb
Contributed-by: takiguc@linux.vnet.ibm.com
--- 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();