[Openmcl-devel] X11 and process-run-function test
Taoufik Dachraoui
taoufik at mazeboard.com
Mon Jan 25 05:04:42 PST 2010
Hi
I am running a test using X11 and get an error when I run the test in lisp
process:
(use-interface-dir :X11)
#+darwin
(open-shared-library "/usr/X11/lib/libX11.dylib")
(defvar *close-app* nil)
(defun x-test ()
(setf *close-app* nil)
(let* ((*display* (with-cstrs ((str ":0.0")) (#_XOpenDisplay str)))
(*screen* (#_XDefaultScreen *display*))
(*visual* (#_XDefaultVisual *display* *screen*))
(*depth* (#_XDefaultDepth *display* *screen*))
(*root* (#_XDefaultRootWindow *display*))
(%wm-delete-window%
(with-cstrs ((str "WM_DELETE_WINDOW"))
(#_XInternAtom *display* str 1)))
(*window* (rlet ((xsetattributes :<XS>et<W>indow<A>ttributes))
(setf (pref xsetattributes :<XS>et<W>indow<A>ttributes.event_mask)
(logior #$ExposureMask))
(#_XCreateWindow *display* *root*
0 0 300 300 0 *depth* 1 *visual* 2048 xsetattributes))))
(rlet ((prot (:array :unsigned-long 1)))
(setf (paref prot (:array :unsigned-long 1) 0) %wm-delete-window%)
(#_XSetWMProtocols *display* *window* prot 1))
(#_XMapWindow *display* *window*)
(rlet ((xev :<XA>ny<E>vent))
(do () (*close-app*)
(#_XNextEvent *display* xev)
(let ((type (pref xev :<XA>ny<E>vent.type))
(window (pref xev :<XA>ny<E>vent.window)))
(if (= type 33) (setf *close-app* t))
(format t "event: type ~A window ~A~%~%" type window)
(force-output t))))
(#_XUnmapWindow *display* *window*)
(#_XCloseDisplay *display*)))
? (x-test)
event: type 12 window 8388609
event: type 12 window 8388609
event: type 33 window 8388609
0
? (process-run-function (string (gensym "XLOOP-")) #'x-test)
#<PROCESS XLOOP-2357(2) [Active] #x90232D6>
? event: type 12 window 8388609
event: type 12 window 8388609
event: type 33 window 8388609
> Error: Fault during read of memory address #xDA
> While executing: (:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION), in process
Initial(0).
;;;
;;; #<PROCESS Initial(0) [Active] #x8355D0E> requires access to Shared
Terminal Input
;;; Type (:y 0) to yield control to this thread.
;;;
Thank you for your help
Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20100125/aa207638/attachment.htm>
More information about the Openmcl-devel
mailing list