Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Experimental featrure) Suspending the X11 screen saver #779

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ magic ?= 0
mkstemps ?= 1
verscmp ?= 1
xinerama ?= 1
x11scrnsaver ?= 1

# Prefix for all installed files
PREFIX ?= /usr/local
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/imlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <X11/extensions/scrnsaver.h>
#endif

Display *disp = NULL;
Visual *vis = NULL;
Screen *scr = NULL;
Expand Down Expand Up @@ -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);
Expand Down