sharplispers / clx

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp
Other
116 stars 46 forks source link

Add missing functionality for screensaver. WIP #60

Closed ebrasca closed 7 years ago

ebrasca commented 8 years ago

Can you read over the code and finish "screen-saver-select-input"?

PuercoPop commented 8 years ago

@ebrasca, as requested on #lisp I'm writing some feedback on the PR. If you wrote some questions on the PR (or by mail) it would be easier for me to understand what problems you are facing. From our exchange on irc I remember you mentioned that you didn't know how to implement that line. But I don't know what exactly are you having trouble with.

So as a general note, first we need to understand what screen-saver-select input does[1]. is the way the client asks to by notified of Screen Saver events. There are two types of Events that one may ask to be notified of:

And the Specification describes those events as

SETofSCREENSAVEREVENT

#x00000001 ScreenSaverNotifyMask
#x00000002 ScreenSaverCycleMask

which translates into

(defconstant +screen-saver-notify-mask+  #x01)
(defconstant +screen-saver-cycle-mask+ #x02)

For this we can see that screen-saver-select-input is missing a parameter, the event mask the client is interest in. For the API it would be more convenient to take a list of keywords and build the event mask inside the function. For that ideally we could use xlib:make-event-mask. However define-event is internal to the xlib package and it doesn't seem to be taylored for extension so I have to read CLX source code some more. I hope this is of some help.

On a more general note:

[1]: See man 3 XScreenSaverSelectInput

ebrasca commented 7 years ago

I stoped working on clx. Thanks you.