diff --git a/config.mk b/config.mk index 5cad7038..cfd9f363 100644 --- a/config.mk +++ b/config.mk @@ -10,6 +10,7 @@ magic ?= 0 mkstemps ?= 1 verscmp ?= 1 xinerama ?= 1 +x11scrnsaver ?= 1 # Prefix for all installed files PREFIX ?= /usr/local @@ -89,6 +90,12 @@ else MAN_XINERAMA = disabled endif +ifeq (${x11scrnsaver},1) + CFLAGS += -DHAVE_X11SCRNSAVER + LDLIBS += -lXss +else +endif + ifeq (${exif},1) CFLAGS += -DHAVE_LIBEXIF LDLIBS += -lexif diff --git a/src/imlib.c b/src/imlib.c index eb3f5224..35a762e3 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -50,6 +50,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. magic_t magic = NULL; #endif +#ifdef HAVE_X11SCRNSAVER +#include +#endif + Display *disp = NULL; Visual *vis = NULL; Screen *scr = NULL; @@ -134,6 +138,10 @@ void init_x_and_imlib(void) init_xinerama(); #endif /* HAVE_LIBXINERAMA */ +#ifdef HAVE_X11SCRNSAVER + XScreenSaverSuspend(disp, True); +#endif + imlib_context_set_display(disp); imlib_context_set_visual(vis); imlib_context_set_colormap(cm);