sharplispers / clx

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

Setfing gcontext-clip-mask to a pixmap and getting it fails #97

Closed uint closed 5 years ago

uint commented 6 years ago

Steps to reproduce

CL-USER> (ql:quickload 'clx/test)
*snip*
CL-USER> (in-package #:xlib)
#<PACKAGE "XLIB">
XLIB> (clx-test-utils:with-default-display display
        (let* ((root-window (screen-root (display-default-screen display)))
               (valid-pixmap (create-pixmap :width 100
                                            :height 100
                                            :depth 1
                                            :drawable root-window))
               (context (create-gcontext :drawable root-window)))
          (gcontext-clip-mask context)                      ; This line succeeds.
          (setf (gcontext-clip-mask context) valid-pixmap)  ; This line succeeds.
          (gcontext-clip-mask context)))                    ; This line fails.

Note that according to the documentation, the pixmap I am trying to apply here is valid.

If a pixmap is specified as the clip-mask, it must have depth one and the same
root as the specified graphics context.

The error

The value
  23068673
is not of type
  (INTEGER 0 0)
when binding #:G2
   [Condition of type TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1007F3FF83}>)

Backtrace:
  0: (GCONTEXT-CLIP-MASK #<GCONTEXT :0 23068674>)
  1: ((LAMBDA ()))
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CLX-TEST-UTILS:WITH-DEFAULT-DISPLAY DISPLAY (LET* (# # #) (GCONTEXT-CLIP-MASK CONTEXT) (SETF # VALID-PIXMAP) (GCONTEXT-CLIP-MASK CONTEXT))) #<NULL-LEXENV>)
  3: (EVAL (CLX-TEST-UTILS:WITH-DEFAULT-DISPLAY DISPLAY (LET* (# # #) (GCONTEXT-CLIP-MASK CONTEXT) (SETF # VALID-PIXMAP) (GCONTEXT-CLIP-MASK CONTEXT))))