summaryrefslogtreecommitdiff
path: root/src/library.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@epoch.ncsc.mil>2004-05-04 19:42:48 +0000
committerEamon Walsh <ewalsh@epoch.ncsc.mil>2004-05-04 19:42:48 +0000
commit2800736baccb6efb09f6ebf4e88cb20b63129aee (patch)
treed380f8dd7791f5a2e602a013a9e707ced757f5b2 /src/library.c
parent5b6ea4938668fe060e591b2ef273183d0e3aea6f (diff)
Merge the new release from HEADXACE-SELINUX
Diffstat (limited to 'src/library.c')
-rw-r--r--src/library.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/library.c b/src/library.c
index 3367a85..b92ac6a 100644
--- a/src/library.c
+++ b/src/library.c
@@ -1,7 +1,6 @@
/*
- * $XFree86: xc/lib/Xcursor/library.c,v 1.3 2003/11/07 17:56:02 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;
}