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

get-property ignores :result-type argument when there is no property. #135

Closed PuercoPop closed 5 years ago

PuercoPop commented 5 years ago

For example

STUMPWM> (xlib:get-property (window-xwin (current-window)) :WM_NORMAL_HINTSzz :type :WM_SIZE_HINTS :result-type 'vector)
NIL
NIL
0 (0 bits, #x0, #o0, #b0)
0 (0 bits, #x0, #o0, #b0)

given that we are asking for a vector I would expect the first value to be #() instead.

From what I see the was some code intended to support that https://github.com/sharplispers/clx/blob/8c063b42f26259084f38718480f00e6cf0b9a03a/requests.lisp#L357

JMC-design commented 5 years ago

The protocol states that when the property doesn't exist none should be returned. The first value is used in quite a few functions as a test. Changing nil to an empty vector/string/list would affect all those, one example #'wm-normal-hints

PuercoPop commented 5 years ago

In CL its is customary for the existence of a value to be communicated in a separate return value, ej. gethash. Ideally CLX should follow lisp conventions but as you mention not breaking existing code is more importancy

dkochmanski commented 5 years ago

In that case I'm closing this as a non-issue (documented behavior).