<div dir="ltr"><div><div><div><div><div>Finally I figured something out. I rewrote the whole thing in Xlib and it did exactly the same thing as my XCB code.<br><br></div>Then I played around with xtrace for too many hours, turns out xscreensaver is NOT using the screensaver extension even though there is code for it in the source. Gnome-screensaver does the same thing but has removed a lot of the code that was in xscreensaver (although other parts are little more than a copy and paste from xscreensaver).<br>
</div>Then lots of google searching and I finally found elock (enlightenment lock program) examination of the source reveals that it ALSO does not use the extension (I wonder if anything out there has ever used it), however, in the source tree is a file called scrnsaver_test.c which doesn't use and enlightenment libraries, so I built it and ran it through xtrace.<br>
<br></div>I was amazed to discover that it CRASHES whenever the screensaver should come on! Hooray!<br></div>I started commenting out lines to see what was actually needed and none of the stuff I had been trying to do in xcb seemed important. Then I saw this line:<br>
if (pe.type == event_base)<br><br></div>And I was like, "event_base?"<br><div><br>turns out that gets set here:<br><br>XScreenSaverQueryExtension (dpy, &event_base, &error_base)<br><br><br></div><div>(which, by the way, is a function never defined in any of the X documentation that I could find). I have been looking for the XCB_SCREENSAVER_NOTIFY or ScreenSaverNotify event, which seems to be <br>
defined as 0. When I should have been looking instead for the event_base returned by XScreenSaverQueryExtension (which I haven't yet figured out how to do in XCB, but I think it will have to do with xcb_query_extension).<br>
<br></div><div>So, basically, I now have an Xlib program that can set the screensaver timeout and gets an event when the screensaver should activate. Converting it to XCB should be easy enough when I am more awake.<br><br>
</div><div>So anyway, the problem is almost resolved. Thanks everybody! Sorry for cluttering your mailing list, but maybe somebody will have the same problem and can find an answer now.<br></div><div class="gmail_extra">
<br>
</div><div class="gmail_extra">--Phil<br></div></div>