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

Can't get property #178

Closed C-Entropy closed 3 years ago

C-Entropy commented 3 years ago

While in xcb, this can get property reply(which is not NULL):

    int screen_default_nbr;
    xcb_connection_t *connection = xcb_connect(NULL, &screen_default_nbr);
    xcb_screen_t *screen = xcb_aux_get_screen(connection, screen_default_nbr);
    xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(connection, false, strlen("XIM_SERVERS"), "XIM_SERVERS");
    xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(connection, atom_cookie, NULL);
    xcb_atom_t atom = atom_reply->atom;
    xcb_get_property_cookie_t cookie = xcb_get_property(connection, false, screen->root, atom,XCB_ATOM_ATOM, 0L,100000L);
    xcb_get_property_reply_t *reply = xcb_get_property_reply(connection, cookie, NULL);

But this in xcb can not(which is NIL):

(let* ((display (open-default-display))
       (screen (display-default-screen display))
       (fg-color (screen-white-pixel screen))
       (bg-color (screen-black-pixel screen))
       (root (screen-root screen))
       (window (create-window :parent root
               :x 10 :y 20
               :event-mask '(:visibility-change)
               :background fg-color
               :width 10 :height 100
               ;; :border-width 2
                  :override-redirect :off)))
  (map-window window)
  (display-finish-output display)
  (intern-atom display :xim_servers)
  (get-property window :xim_servers))

what happen here, what should I do to get the property?

C-Entropy commented 3 years ago

Orzk, Alright, my bad. It should be (root-window screen),not window itself.