summaryrefslogtreecommitdiff
path: root/src/wallpaper.c
diff options
context:
space:
mode:
authorSven Willner <sven.willner@gmail.com>2019-04-01 13:58:50 +0200
committerSven Willner <sven.willner@gmail.com>2019-04-01 13:58:50 +0200
commita9ffd5d2234433bc3f3829713b0968a1d6c13b94 (patch)
tree78a78930edbf7c187e0803f367529f2aabc90627 /src/wallpaper.c
parent1d3d1259590c8a600c3d800942ab5566802d3499 (diff)
parent18dd1c5ea218c1b86e305d3ee0052335b1e22fc8 (diff)
Merge remote-tracking branch 'original/master'
Diffstat (limited to 'src/wallpaper.c')
-rw-r--r--src/wallpaper.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/wallpaper.c b/src/wallpaper.c
index db14a8c..9df259f 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -252,7 +252,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
XGCValues gcval;
GC gc;
char bgname[20];
- int num = (int) rand();
+ int num = (int) random();
char bgfil[4096];
char sendbuf[4096];
@@ -502,15 +502,16 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
}
fputc(' ', fp);
if (use_filelist) {
- for (int i = 0; i < cmdargc; i++) {
- if (filelist_pos && !strcmp(FEH_FILE(filelist_pos->data)->filename, cmdargv[i])) {
- /* argument is a file */
- absolute_path = feh_absolute_path(cmdargv[i]);
- fputs(shell_escape(absolute_path), fp);
- filelist_pos = filelist_pos->next;
- free(absolute_path);
- fputc(' ', fp);
- }
+#ifdef HAVE_LIBXINERAMA
+ for (int i = 0; (i < opt.xinerama ? num_xinerama_screens : 1) && filelist_pos; i++) {
+#else
+ for (int i = 0; (i < 1 ) && filelist_pos; i++) {
+#endif
+ absolute_path = feh_absolute_path(FEH_FILE(filelist_pos->data)->filename);
+ fputs(shell_escape(absolute_path), fp);
+ filelist_pos = filelist_pos->next;
+ free(absolute_path);
+ fputc(' ', fp);
}
} else if (fil) {
absolute_path = feh_absolute_path(fil);