Default to the default value of $XDG_CACHE_DIR in case $XDG_CACHE_DIR is
not set. Both the current behavior and this commit are valid according to the XDG base directory standard, however realistically no one wants dotfiles in their home directory, and that's what would happen if $XDG_CACHE_DIR is unset. Also fix key inconsistency between X and Wayland.
This commit is contained in:
parent
7389d28be5
commit
ca624e1ca6
|
@ -259,7 +259,7 @@ void loadimagecache(const char *file, int *width, int *height) {
|
||||||
if (xdg_cache || !strcmp(cachedir, "xdg"))
|
if (xdg_cache || !strcmp(cachedir, "xdg"))
|
||||||
slen = snprintf(NULL, 0, "%s/thumbnails/%s/%s.png", xdg_cache, dsize, md5)+1;
|
slen = snprintf(NULL, 0, "%s/thumbnails/%s/%s.png", xdg_cache, dsize, md5)+1;
|
||||||
else
|
else
|
||||||
slen = snprintf(NULL, 0, "%s/.thumbnails/%s/%s.png", home, dsize, md5)+1;
|
slen = snprintf(NULL, 0, "%s/.cache/thumbnails/%s/%s.png", home, dsize, md5)+1;
|
||||||
} else {
|
} else {
|
||||||
slen = snprintf(NULL, 0, "%s/%s/%s.png", cachedir, dsize, md5)+1;
|
slen = snprintf(NULL, 0, "%s/%s/%s.png", cachedir, dsize, md5)+1;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ void loadimagecache(const char *file, int *width, int *height) {
|
||||||
if (xdg_cache)
|
if (xdg_cache)
|
||||||
sprintf(buf, "%s/thumbnails/%s/%s.png", xdg_cache, dsize, md5);
|
sprintf(buf, "%s/thumbnails/%s/%s.png", xdg_cache, dsize, md5);
|
||||||
else
|
else
|
||||||
sprintf(buf, "%s/.thumbnails/%s/%s.png", home, dsize, md5);
|
sprintf(buf, "%s/.cache/thumbnails/%s/%s.png", home, dsize, md5);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s/%s/%s.png", cachedir, dsize, md5);
|
sprintf(buf, "%s/%s/%s.png", cachedir, dsize, md5);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,4 @@ static void grabkeyboard_x11(void);
|
||||||
static void getcapsstate(void);
|
static void getcapsstate(void);
|
||||||
|
|
||||||
static Key ckeys[256];
|
static Key ckeys[256];
|
||||||
static Key hkeys[1] = { { -1, Ctrl|Alt|Shift, XK_Delete, quit, {0} } };
|
static Key hkeys[1] = { { -1, Ctrl|Alt, XK_Delete, quit, {0} } };
|
||||||
|
|
Loading…
Reference in a new issue