Posted to tcl by emiliano at Sat Jan 22 17:32:47 GMT 2011view pretty
emiliano@merlot:~/src/tk$ cvs diff -u unix/tkUnixCursor.c
Index: unix/tkUnixCursor.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixCursor.c,v
retrieving revision 1.15
diff -u -r1.15 tkUnixCursor.c
--- unix/tkUnixCursor.c 5 Nov 2008 22:48:58 -0000 1.15
+++ unix/tkUnixCursor.c 22 Jan 2011 17:23:51 -0000
@@ -12,6 +12,9 @@
*/
#include "tkInt.h"
+#ifdef HAVE_XCURSOR
+#include <X11/Xcursor/Xcursor.h>
+#endif
/*
* The following data structure is a superset of the TkCursor structure
@@ -325,9 +328,15 @@
goto badString;
}
+#ifdef HAVE_XCURSOR
+ if (!inTkTable && (argc != 1) && (argc != 2) && (argc != 4)) {
+ goto badString;
+ }
+#else
if (!inTkTable && (argc != 2) && (argc != 4)) {
goto badString;
}
+#endif /* HAVE_XCURSOR */
cursor = CreateCursorFromTableOrFile(interp, tkwin, argc, argv,
tkCursorPtr);
@@ -429,6 +438,11 @@
source = XCreateBitmapFromData(display, drawable, data, width,height);
ckfree(data);
} else {
+#ifdef HAVE_XCURSOR
+ cursor = XcursorFilenameLoadCursor(display, &argv[0][1]);
+ if (cursor != None)
+ goto cleanup;
+#endif /* HAVE_XCURSOR */
if (TkReadBitmapFile(display, drawable, &argv[0][1],
(unsigned *) &width, (unsigned *) &height,
&source, &xHot, &yHot) != BitmapSuccess) {