xsecurelock  1.7.0
XSecureLock is an X11 screen lock utility.
Functions | Variables
saver_child.c File Reference
#include "saver_child.h"
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include "logging.h"
#include "wait_pgrp.h"
#include "xscreensaver_api.h"

Functions

void KillAllSaverChildrenSigHandler (int signo)
 Kill all saver children. More...
 
void WatchSaverChild (Display *dpy, Window w, int index, const char *executable, int should_be_running)
 Starts or stops the screen saver child process. More...
 

Variables

static pid_t saver_child_pid [MAX_SAVERS] = {0}
 The PIDs of currently running saver children, or 0 if not running. More...
 

Function Documentation

◆ KillAllSaverChildrenSigHandler()

void KillAllSaverChildrenSigHandler ( int  signo)

Kill all saver children.

This can be used from a signal handler.

◆ WatchSaverChild()

void WatchSaverChild ( Display *  dpy,
Window  w,
int  index,
const char *  executable,
int  should_be_running 
)

Starts or stops the screen saver child process.

Parameters
dpyThe X11 display.
wThe screen saver window. Will get cleared after saver child execution.
indexThe index of the saver to maintain (0 <= index < MAX_SAVERS).
executableWhat binary to spawn for screen saving. No arguments will be passed.
should_be_runningIf true, the saver child is started if not running yet; if alse, the saver child will be terminated.

Variable Documentation

◆ saver_child_pid

pid_t saver_child_pid[MAX_SAVERS] = {0}
static

The PIDs of currently running saver children, or 0 if not running.