diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:28:52 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:28:52 +0000 |
commit | 24b087709323ddb4acc49355387c06da337151e0 (patch) | |
tree | ceabbb953226f775a7347183bcf763ca6fb11b37 /src/library.c | |
parent | 2f241334d765ff17777a756afc81e8da6a9f1ff2 (diff) | |
download | xorg-lib-libXcursor-24b087709323ddb4acc49355387c06da337151e0.tar.gz |
merge with XORG-RELEASE-1 (tag XORG-CYGWIN-LAST-MERGE)CYGWIN-RELEASE-1-MERGECYGWIN-PRE-6_8_0-MERGECYGWIN-HEAD-MERGECYGWIN-HEAD-LAST-MERGE
Diffstat (limited to 'src/library.c')
-rw-r--r-- | src/library.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/library.c b/src/library.c index b359c45..99af99e 100644 --- a/src/library.c +++ b/src/library.c @@ -1,7 +1,7 @@ /* - * $XFree86: xc/lib/Xcursor/library.c,v 1.4 2003/11/11 01:17:54 dawes Exp $ + * $Id$ * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. + * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -32,8 +32,8 @@ #define CURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:"ICONDIR -static const char * -_XcursorLibraryPath (void) +const char * +XcursorLibraryPath (void) { static const char *path; @@ -101,19 +101,16 @@ _XcursorBuildThemeDir (const char *dir, const char *theme) if (!home) return 0; homelen = strlen (home); - /* A '/' gets prepended if $HOME doesn't start with one. */ - if (home[0] != '/') - homelen++; dir++; dirlen--; } - len = homelen + dirlen + 1 + themelen + 1; + /* + * add space for any needed directory separators, one per component, + * and one for the trailing null + */ + len = 1 + homelen + 1 + dirlen + 1 + themelen + 1; - /* A '/' gets inserted if dir doesn't start with one. */ - if (dir[0] != '/') - len++; - full = malloc (len); if (!full) return 0; @@ -222,7 +219,7 @@ XcursorScanTheme (const char *theme, const char *name) /* * Scan this theme */ - for (path = _XcursorLibraryPath (); + for (path = XcursorLibraryPath (); path && f == 0; path = _XcursorNextPath (path)) { @@ -292,6 +289,8 @@ XcursorLibraryLoadImages (const char *file, const char *theme, int size) if (f) { images = XcursorFileLoadImages (f, size); + if (images) + XcursorImagesSetName (images, file); fclose (f); } return images; @@ -316,6 +315,9 @@ XcursorLibraryLoadCursor (Display *dpy, const char *file) } cursor = XcursorImagesLoadCursor (dpy, images); XcursorImagesDestroy (images); +#if defined HAVE_XFIXES && XFIXES_MAJOR >= 2 + XFixesSetCursorName (dpy, cursor, file); +#endif return cursor; } |