From b0ffd78e6ec79d8749066eb176766a443fd63fca Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sun, 12 Jun 2016 21:52:27 -0400 Subject: doc: move xscreensaver_notes, and small update --- doc/xscreensaver_notes.txt | 30 ++++++++++++++++++++++++++++++ xscreensaver_notes.txt | 35 ----------------------------------- 2 files changed, 30 insertions(+), 35 deletions(-) create mode 100644 doc/xscreensaver_notes.txt delete mode 100644 xscreensaver_notes.txt diff --git a/doc/xscreensaver_notes.txt b/doc/xscreensaver_notes.txt new file mode 100644 index 0000000..2c91ddc --- /dev/null +++ b/doc/xscreensaver_notes.txt @@ -0,0 +1,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 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 + diff --git a/xscreensaver_notes.txt b/xscreensaver_notes.txt deleted file mode 100644 index e8c7238..0000000 --- a/xscreensaver_notes.txt +++ /dev/null @@ -1,35 +0,0 @@ - -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 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?) - -new plan: -- write a function that just returns a glutin::Window based on the remote X11 - window ID - -old plan: -- provide an impl on glutin::Window which constructs a new one given a root - window number; just copy/paste the new() implementation for now? - "from_existing()"? -- cgit v1.2.3