diff options
author | Egbert Eich <eich@suse.de> | 2004-03-09 16:52:30 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-03-09 16:52:30 +0000 |
commit | 6f8690d1315566cc7b43016d5c2e697bf86d6200 (patch) | |
tree | ceabbb953226f775a7347183bcf763ca6fb11b37 /src/library.c | |
parent | 4510bb5692ff7e210b1c7f6523191de09b5bae1f (diff) |
25. Updating Xcursor, Xrender, Xft (Egbert Eich).xo-6_7_0XPRINT_BEGINXPRINT_BASEXORG-TM-CYGWIN-MERGEXORG-TM-CYGWIN-LAST-MERGEXORG-RELEASE-1-TM-MERGEXORG-RELEASE-1-TM-CLOSEDXORG-RELEASE-1-TM-BASEXORG-RELEASE-1-STSF-FORKXORG-RELEASE-1-MERGEXORG-CYGWIN-MERGEXORG-CYGWIN-LAST-MERGEXORG-6_7_0IPv6-REVIEW-BASEXPRINTXORG-RELEASE-1-TMXORG-RELEASE-1-STSFXORG-RELEASE-1IPv6-REVIEW
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 3367a85..99af99e 100644 --- a/src/library.c +++ b/src/library.c @@ -1,7 +1,7 @@ /* - * $XFree86: xc/lib/Xcursor/library.c,v 1.3 2003/11/07 17:56:02 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; } |