summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/feh.h2
-rw-r--r--src/options.c10
-rw-r--r--src/signals.c13
-rw-r--r--src/signals.h2
-rw-r--r--src/slideshow.c4
-rw-r--r--src/wallpaper.c19
-rw-r--r--src/winwidget.c1
7 files changed, 29 insertions, 22 deletions
diff --git a/src/feh.h b/src/feh.h
index 1d5e918..15da763 100644
--- a/src/feh.h
+++ b/src/feh.h
@@ -152,7 +152,7 @@ void feh_event_handle_stdin();
void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysym, unsigned int button);
fehkey *feh_str_to_kb(char * action);
void feh_action_run(feh_file * file, char *action, winwidget winwid);
-char *format_size(int size);
+char *format_size(double size);
char *feh_printf(char *str, feh_file * file, winwidget winwid);
void im_weprintf(winwidget w, char *fmt, ...);
void feh_draw_zoom(winwidget w);
diff --git a/src/options.c b/src/options.c
index 34e248e..37fad88 100644
--- a/src/options.c
+++ b/src/options.c
@@ -470,6 +470,8 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
if (opt.slideshow_delay < 0.0) {
opt.slideshow_delay *= (-1);
opt.paused = 1;
+ } else {
+ opt.paused = 0;
}
break;
case 'E':
@@ -751,10 +753,12 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
break;
case 234:
opt.info_cmd = estrdup(optarg);
- if (opt.info_cmd[0] == ';')
+ if (opt.info_cmd[0] == ';') {
+ opt.draw_info = 0;
opt.info_cmd++;
- else
+ } else {
opt.draw_info = 1;
+ }
break;
case 235:
opt.force_aliasing = 1;
@@ -834,8 +838,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
add_file_to_filelist_recursively(".", FILELIST_FIRST);
}
}
- else if (finalrun && !opt.filelistfile && !opt.bgmode)
- add_file_to_filelist_recursively(".", FILELIST_FIRST);
/* So that we can safely be called again */
optind = 0;
diff --git a/src/signals.c b/src/signals.c
index d65f49b..85d81bc 100644
--- a/src/signals.c
+++ b/src/signals.c
@@ -24,6 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "feh.h"
+#include "filelist.h"
#include "winwidget.h"
#include "options.h"
@@ -94,10 +95,14 @@ void feh_handle_signal(int signo)
winwid = winwidget_get_first_window_of_type(WIN_TYPE_SLIDESHOW);
if (winwid) {
- if (signo == SIGUSR1)
- slideshow_change_image(winwid, SLIDE_NEXT, 1);
- else if (signo == SIGUSR2)
- slideshow_change_image(winwid, SLIDE_PREV, 1);
+ if (filelist_len > 1) {
+ if (signo == SIGUSR1)
+ slideshow_change_image(winwid, SLIDE_NEXT, 1);
+ else if (signo == SIGUSR2)
+ slideshow_change_image(winwid, SLIDE_PREV, 1);
+ } else {
+ feh_reload_image(winwid, 0, 0);
+ }
} else if (opt.multiwindow) {
for (i = window_num - 1; i >= 0; i--)
feh_reload_image(windows[i], 0, 0);
diff --git a/src/signals.h b/src/signals.h
index 38fc0d2..bff737e 100644
--- a/src/signals.h
+++ b/src/signals.h
@@ -27,5 +27,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SIGNALS_H
void setup_signal_handlers();
-volatile extern int sig_exit;
+extern volatile int sig_exit;
#endif
diff --git a/src/slideshow.c b/src/slideshow.c
index 145ced1..ac8c545 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -445,7 +445,7 @@ void feh_action_run(feh_file * file, char *action, winwidget winwid)
return;
}
-char *format_size(int size)
+char *format_size(double size)
{
static char ret[5];
char units[] = {' ', 'k', 'M', 'G', 'T'};
@@ -454,7 +454,7 @@ char *format_size(int size)
size /= 1000;
postfix++;
}
- snprintf(ret, 5, "%3d%c", size, units[postfix]);
+ snprintf(ret, 5, "%3.0f%c", size, units[postfix]);
return ret;
}
diff --git a/src/wallpaper.c b/src/wallpaper.c
index ef7ecca..9df259f 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -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);
diff --git a/src/winwidget.c b/src/winwidget.c
index 4f5f4a6..bb4fdae 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -203,7 +203,6 @@ void winwidget_create_window(winwidget ret, int w, int h)
}
if (opt.paused) {
- printf("name %s\n", ret->name);
tmpname = estrjoin(" ", ret->name, "[Paused]", NULL);
free(ret->name);
ret->name = tmpname;