The XScreenSaver
daemon is responsible for detecting idle-ness, blanking and locking the screen, and launching the display modes. The display modes (termed "hacks" from the historical usage "
display hack") are each stand-alone programs. This is an important security feature, in that the display modes are
sandboxed into a separate process from the screen locking framework. This means that a programming error in one of the graphical display modes cannot compromise the screen locker itself (e.g., a crash in a display mode will not unlock the screen). It also means that a third-party screen saver can be written in any language or with any graphics library, so long as it is capable of rendering onto an externally provided window. For historical and portability reasons, the included hacks are all written in
ANSI C. About half of them use the
X11 API, and about half use the
OpenGL 1.3 API. Rather than cloning the code-base and re-writing the hacks to target different platforms, XScreenSaver contains a number of compatibility layers. • To allow the X11-based hacks to run natively on macOS and iOS, XScreenSaver contains a complete implementation of the X11 API built on top of
Cocoa ("jwxyz"). • To allow the OpenGL 1.3-based hacks to run natively on iOS and Android systems, which only support
OpenGL ES, XScreenSaver contains an implementation of the OpenGL 1.3 API built on top of OpenGL ES 1.0 ("jwzgles"). • And to allow the X11-based hacks to run natively on iOS and Android, XScreenSaver also contains an implementation of the X11 API in terms of OpenGL ES 1.0. ==References==