diff options
author | Egbert Eich <eich@suse.de> | 2004-04-23 18:43:40 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-04-23 18:43:40 +0000 |
commit | cbcf471d9157c88a506cd3f067253c8e64cb8e08 (patch) | |
tree | d380f8dd7791f5a2e602a013a9e707ced757f5b2 /src/library.c | |
parent | fb1739bd2272fa45d9c04fe40517468a49660b37 (diff) |
Merging XORG-CURRENT into trunkxprint_packagertest_20041125_baserel-0-6-1lg3d-rel-0-7-0lg3d-rel-0-6-2lg3d-baseXORG-6_8_2XORG-6_8_1_904XORG-6_8_1_903XORG-6_8_1_902XORG-6_8_1_901XORG-6_8_1XORG-6_8_0XORG-6_7_99_904XORG-6_7_99_903XORG-6_7_99_902XORG-6_7_99_901XORG-6_7_99_2XORG-6_7_99_1XACE-SELINUX-MERGExprint_packagertest_20041125lg3d-masterlg3d-eventlg3d-dev-0-7-1lg3d-dev-0-7-0lg3d-dev-0-6-latestlg3d-dev-0-6-2lg3d-dev-0-6-1-latestlg3d-dev-0-6-1-currentlg3d-dev-0-6-1-1lg3d-dev-0-6-1lg3dXORG-6_8-branchCOMPOSITEWRAP
Diffstat (limited to 'src/library.c')
-rw-r--r-- | src/library.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/library.c b/src/library.c index b359c45..b92ac6a 100644 --- a/src/library.c +++ b/src/library.c @@ -1,7 +1,6 @@ /* - * $XFree86: xc/lib/Xcursor/library.c,v 1.4 2003/11/11 01:17:54 dawes Exp $ * - * 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 +31,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 +100,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 +218,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 +288,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 +314,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; } |