[AD] Xcursor related patches |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
The first patch simply allows you to pass configure
--disable-xwin-xcursor to check that the X port still compiles without
the Xcursor library.
The second patch fixes a memory leak when Xcursor is used.
Evert, I'll let you commit these if they're okay.
Peter
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/alleg/allegro/aclocal.m4,v
retrieving revision 1.73
diff -u -r1.73 aclocal.m4
--- aclocal.m4 13 Dec 2004 11:14:58 -0000 1.73
+++ aclocal.m4 12 Mar 2005 04:03:25 -0000
@@ -211,6 +211,7 @@
dnl Test for X-Windows support.
dnl
dnl Variables:
+dnl allegro_enable_xwin_xcursor=(yes|)
dnl allegro_enable_xwin_shm=(yes|)
dnl allegro_enable_xwin_xf86vidmode=(yes|)
dnl allegro_enable_xwin_xf86dga=(yes|)
@@ -220,7 +221,11 @@
dnl CPPFLAGS, LDFLAGS and LIBS can be modified.
dnl
AC_DEFUN(ALLEGRO_ACTEST_SUPPORT_XWINDOWS,
-[AC_ARG_ENABLE(xwin-shm,
+[AC_ARG_ENABLE(xwin-xcursor,
+[ --enable-xwin-xcursor[=x] enable the use of Xcursor library [default=yes]],
+test "X$enableval" != "Xno" && allegro_enable_xwin_xcursor=yes,
+allegro_enable_xwin_xcursor=yes)
+AC_ARG_ENABLE(xwin-shm,
[ --enable-xwin-shm[=x] enable the use of MIT-SHM Extension [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_xwin_shm=yes,
allegro_enable_xwin_shm=yes)
@@ -264,17 +269,19 @@
)
dnl Test for Xcursor library.
- AC_CHECK_LIB(Xcursor, XcursorImageCreate,
- AC_TRY_COMPILE([#include <X11/Xlib.h>
- #include <X11/Xcursor/Xcursor.h>],
- [XcursorImage *xcursor_image;
- XcursorImageLoadCursor(0, xcursor_image);
- XcursorSupportsARGB(0);
- ],
- [LIBS="-lXcursor $LIBS"
- AC_DEFINE(ALLEGRO_XWINDOWS_WITH_XCURSOR,1,[Define if XCursor ARGB extension is available.])
- ])
- )
+ if test -n "$allegro_enable_xwin_xcursor"; then
+ AC_CHECK_LIB(Xcursor, XcursorImageCreate,
+ AC_TRY_COMPILE([#include <X11/Xlib.h>
+ #include <X11/Xcursor/Xcursor.h>],
+ [XcursorImage *xcursor_image;
+ XcursorImageLoadCursor(0, xcursor_image);
+ XcursorSupportsARGB(0);
+ ],
+ [LIBS="-lXcursor $LIBS"
+ AC_DEFINE(ALLEGRO_XWINDOWS_WITH_XCURSOR,1,[Define if XCursor ARGB extension is available.])
+ ])
+ )
+ fi
dnl Test for SHM extension.
if test -n "$allegro_enable_xwin_shm"; then
Index: src/x/xwin.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xwin.c,v
retrieving revision 1.84
diff -u -r1.84 xwin.c
--- src/x/xwin.c 1 Feb 2005 13:12:12 -0000 1.84
+++ src/x/xwin.c 12 Mar 2005 04:03:34 -0000
@@ -453,6 +453,13 @@
_xwin.cursor = None;
}
+#ifdef ALLEGRO_XWINDOWS_WITH_XCURSOR
+ if (_xwin.xcursor_image != None) {
+ XcursorImageDestroy(_xwin.xcursor_image);
+ _xwin.xcursor_image = None;
+ }
+#endif
+
_xwin.visual = 0;
if (_xwin.gc != None) {