aboutsummaryrefslogtreecommitdiffstats
path: root/doc/xscreensaver_notes.txt
blob: 2c91ddc3bbb48188bdc6cc1808701954327491e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

The API is basically to grab the window ID from $XSCREENSAVER_WINDOW (could be
hex or decimal) and draw to that. There are also the following command line
options:

    -root               find the "root" window for this screen and draw in it
    -window             create an X window and draw in it
    -window-id <arg>    draw in the given window
    -pair

Also unclear how OpenGL-based hacks differ from Xlib-based hacks (in terms of
window selection).

The code in glutin (rust) that creates a Window object is:

    https://github.com/tomaka/glutin/blob/master/src/api/x11/window.rs
    glutin/src/api/x11/window.rs:421

    // getting the root window
    let root = unsafe { (display.xlib.XDefaultRootWindow)(display.display) };
    display.check_errors().expect("Failed to get root window");

The code in XScreensaver "hacks" that seems to latch on to an existing window is:

    https://github.com/Zygo/xscreensaver/blob/master2/hacks/screenhack.c#L872
    (possible section of xscreensaver hack code dealing with window stuff?)

After figuring all this out, I found a perl equivalent:
http://search.cpan.org/dist/OpenGL-XScreenSaver/lib/OpenGL/XScreenSaver.pm