summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-02-27 18:47:00 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-02-27 18:47:11 +0100
commit0be6d72c5b9e8c51b89d2a48a4cee37175dfb9af (patch)
treea1cae289509bd87b778e33bc2132b4b17bc53af3
parentc9059ad473c867e1af1407f90a9d8fc5637d167a (diff)
always use absolute paths in .fehbg
-rw-r--r--ChangeLog1
-rw-r--r--src/menu.c12
-rw-r--r--src/wallpaper.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 23f46fd..b3c5988 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@ git HEAD
* feh.desktop: Use feh %F since we support multiple files
* Fix --borderless not working on some 64bit systems
(Patch by Brian Mattern)
+ * Always use absolute paths in .fehbg
Tue, 11 Jun 2013 08:27:24 +0200 Daniel Friesel <derf+feh@finalrewind.org>
diff --git a/src/menu.c b/src/menu.c
index 722ce02..c18bbbb 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1183,24 +1183,20 @@ void feh_menu_cb(feh_menu * m, feh_menu_item * i, int action, unsigned short dat
switch (action) {
case CB_BG_TILED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 0, 0, data, 0);
- free(path);
break;
case CB_BG_SCALED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 1, 0, data, 0);
- free(path);
break;
case CB_BG_CENTERED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 1, 0, 0, data, 0);
- free(path);
break;
case CB_BG_FILLED:
- path = feh_absolute_path(FEH_FILE(m->fehwin->file->data)->filename);
+ path = FEH_FILE(m->fehwin->file->data)->filename;
feh_wm_set_bg(path, m->fehwin->im, 0, 0, 1, data, 0);
- free(path);
break;
case CB_BG_TILED_NOFILE:
feh_wm_set_bg(NULL, m->fehwin->im, 0, 0, 0, data, 0);
diff --git a/src/wallpaper.c b/src/wallpaper.c
index 886beb6..b5945f0 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -310,6 +310,8 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
if (fil && !use_filelist) {
filbuf[out++] = '\'';
+ fil = feh_absolute_path(fil);
+
for (in = 0; fil[in] && out < 4092; in++) {
if (fil[in] == '\'')
@@ -317,12 +319,13 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
filbuf[out++] = fil[in];
}
filbuf[out++] = '\'';
+ free(fil);
} else {
for (l = filelist; l && out < 4092; l = l->next) {
filbuf[out++] = '\'';
- fil = FEH_FILE(l->data)->filename;
+ fil = feh_absolute_path(FEH_FILE(l->data)->filename);
for (in = 0; fil[in] && out < 4092; in++) {
@@ -332,6 +335,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
}
filbuf[out++] = '\'';
filbuf[out++] = ' ';
+ free(fil);
}
}