From 1e03474b483e75147a60d0c3d52332d4f0901aab Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 8 Feb 2010 19:26:43 +0100 Subject: Make -O work without X as well. Closes bugs.debian.org #373209 --- src/feh.h | 1 + src/imlib.c | 18 +++++++++++++----- src/main.c | 4 +++- src/options.c | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/feh.h b/src/feh.h index ea8657c..5e2826b 100644 --- a/src/feh.h +++ b/src/feh.h @@ -106,6 +106,7 @@ void show_usage(void); void show_version(void); int feh_main_iteration(int block); void feh_handle_event(XEvent * ev); +void init_imlib_fonts(void); void init_x_and_imlib(void); #ifdef HAVE_LIBXINERAMA void init_xinerama(void); diff --git a/src/imlib.c b/src/imlib.c index 3d829ce..1b2ae12 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -66,6 +66,19 @@ init_xinerama(void) } #endif /* HAVE_LIBXINERAMA */ +void +init_imlib_fonts(void) +{ + D_ENTER(4); + + /* Set up the font stuff */ + imlib_add_path_to_font_path("."); + imlib_add_path_to_font_path(PREFIX "/share/feh/fonts"); + imlib_add_path_to_font_path("./ttfonts"); + + D_RETURN_(4); +} + void init_x_and_imlib(void) { @@ -96,11 +109,6 @@ init_x_and_imlib(void) /* Initialise random numbers */ srand(getpid() * time(NULL) % ((unsigned int) -1)); - /* Set up the font stuff */ - imlib_add_path_to_font_path("."); - imlib_add_path_to_font_path(PREFIX "/share/feh/fonts"); - imlib_add_path_to_font_path("./ttfonts"); - D_RETURN_(4); } diff --git a/src/main.c b/src/main.c index 673a00a..74a4144 100644 --- a/src/main.c +++ b/src/main.c @@ -44,7 +44,9 @@ main(int argc, char **argv) init_parse_options(argc, argv); - if (!opt.list) + init_imlib_fonts(); + + if (opt.display) init_x_and_imlib(); feh_event_init(); diff --git a/src/options.c b/src/options.c index c41645f..cd96613 100644 --- a/src/options.c +++ b/src/options.c @@ -460,6 +460,7 @@ feh_parse_option_array(int argc, char **argv) break; case 'l': opt.list = 1; + opt.display = 0; break; case 'G': opt.wget_timestamp = 1; -- cgit v1.2.3