[clfswm-devel] Type Error in CLFSWM::ADAPT-CHILD-TO-RECT
Philippe Brochard
pbrochard at common-lisp.net
Thu Dec 22 22:40:51 UTC 2011
Desmond O. Chang writes:
> Hi all,
>
Hi,
> Did anyone get an error like "-63634 isn't a CARD16." when using
> clfswm with clisp/new-clx?
>
Yes I got this error with clisp/new-clx. But not with clisp/mit-clx or
portable-clx.
The problem comes from the layout manager which set a negative width.
Have you seen which layout causes the trouble? And which application?
I've written a wrapper to all xlib:drawable-* functions to prevent this
and report errors. It's in the fix-type-error branch in the
common-lisp.net git repository: git://common-lisp.net/projects/clfswm/clfswm.git
I don't think it's a good solution, a better one will be to see which
layout cause this trouble and with which application. But I'll merge it
in the master branch if we find nothing better.
> This bug doesn't occur so often. I made a screenshot [1].
>
I got this too.
> The error is from the SETF sexp in CLFSWM::ADAPT-CHILD-TO-RECT:
>
> (setf (xlib:drawable-x window) (child-rect-x rect)
> (xlib:drawable-y window) (child-rect-y rect)
> (xlib:drawable-width window) (child-rect-w rect)
> (xlib:drawable-height window) (child-rect-h rect)))
>
> clisp/new-clx [2] requires that the types of the values of
> CHILD-RECT-* must be:
>
> CHILD-RECT-X: INT16
> CHILD-RECT-Y: INT16
> CHILD-RECT-W: CARD16
> CHILD-RECT-H: CARD16
>
> INT16 is (SIGNED-BYTE 16) and CARD16 is (UNSIGNED-BYTE 16) [3].
>
> When CHILD-RECT-W returns -63634 which isn't CARD16, the error will
> occur. To fix this bug, I convert -63634 to 1902, by redefining the
> function. A simple patch is on the branch 'fix-type-error' at [4].
>
> It's just my workaround and should not be merged. A better solution
> may be redefining CHILD-RECT-* or else.
>
child-rect-* are just here to store windows and frames placement and to
calculate children order. They're set by the layout manager. It'll be
better to change the layout functions.
Please, can you use the fix-type-error branch on the common-lisp.net git
repo to see if you can isolate a layout which cause this error.
It'll be really useful if you have found an application which cause this
error in all cases. I haven't found one.
Thanks a lot for this report,
Regards,
Philippe
More information about the clfswm-devel
mailing list