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

How to change property with pixmap #184

Open C-Entropy opened 3 years ago

C-Entropy commented 3 years ago

Code in C:

XChangeProperty(disp2, root2, prop_root, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &pmap_d2, 1);

How to do this in clx? I tried something like this:

(setf *pixmap* (xlib:create-pixmap
        :drawable *root*
        :width (xlib:drawable-width *root*)
        :height (xlib:drawable-height *root*)
        :depth (xlib:drawable-depth *root*)))
(xlib:change-property *root*
              :_XROOTMAP_ID
              *pixmap*
              :pixmap
              32
              :mode :replace)

but apperently, *pixmap* will just not work. Do I have to get address of pixmap? And how?

JMC-design commented 3 years ago

change-property doesn't transform data for you, that's what the TRANSFORM key is for. you should use #'xlib:drawable-id as transform and 'xlib:pixmap should work as type.