Skip to content

Commit

Permalink
I suspect the code is okay but there is some issue with weston-termin…
Browse files Browse the repository at this point in the history
…al that causes it to segfault when using SBCL. weston-terminal works fine with CCL and everything else seems to work fine with either. It's maybe best therefore to recommend running with CCL.
  • Loading branch information
malcolmstill committed Jan 22, 2017
1 parent 97b935b commit 4c23b8d
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 138 deletions.
3 changes: 2 additions & 1 deletion compositor.lisp
Expand Up @@ -72,7 +72,7 @@
(find-if (lambda (client)
(and (pointerp (waylisp:->client client)) (pointer-eq (waylisp:->client client) client-pointer)))
(clients compositor)))
|#
(defun find-surface (surface-pointer compositor)
(find-if (lambda (surface)
Expand All @@ -88,6 +88,7 @@
(and (pointerp (waylisp:->surface surface)) (pointer-eq (waylisp:->surface surface) surface-pointer)))
(surfaces client)))
(clients compositor)))
|#

(defun remove-client (client-pointer)
(let ((client (get-client client-pointer)))
Expand Down
6 changes: 3 additions & 3 deletions render.lisp
Expand Up @@ -204,9 +204,9 @@
(array (gensym "array")))
`(let* ((,x (x ,surface))
(,y (y ,surface))
(,texture (waylisp:texture ,surface))
(,width (waylisp:width ,texture))
(,height (waylisp:height ,texture))
(,texture (texture (wl-surface ,surface)))
(,width (width (wl-surface ,texture)))
(,height (height (wl-surface ,texture)))
(,array (cepl:make-gpu-array (list (list (cepl:v! 0 0 ,z)
(cepl:v! 0 0))
(list (cepl:v! ,width 0 ,z)
Expand Down
1 change: 1 addition & 0 deletions ulubis.asd
Expand Up @@ -12,6 +12,7 @@
#:cl-xkb
#:cl-wayland
#:trivial-dump-core
#:trivial-backtrace
#:uiop)
:serial t
:components ((:file "backend")
Expand Down
8 changes: 6 additions & 2 deletions ulubis.lisp
Expand Up @@ -136,7 +136,11 @@

(defun initialise ()
(unwind-protect
(progn
(block main-handler
(handler-bind ((error #'(lambda (e)
(format t "~%Oops! Something went wrong with ulubis...we throw ourselves at your mercy! Exiting wih error:~%")
(trivial-backtrace:print-backtrace e)
(return-from main-handler))))
#+sbcl
(sb-int:set-floating-point-modes :traps nil)

Expand Down Expand Up @@ -254,7 +258,7 @@
(setf (running *compositor*) t)
(if (string-equal (symbol-name backend-name) "backend-drm-gbm")
(main-loop-drm (wl-display-get-event-loop (display *compositor*)))
(main-loop-sdl (wl-display-get-event-loop (display *compositor*)))))
(main-loop-sdl (wl-display-get-event-loop (display *compositor*))))))
(when (display *compositor*)
(wl-display-destroy (display *compositor*))
(setf (display *compositor*) nil))
Expand Down
18 changes: 1 addition & 17 deletions wl-compositor-impl.lisp
Expand Up @@ -15,20 +15,4 @@
())

(def-wl-bind compositor-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((compositor (make-wl-compositor client 1 id)))
(format t "Made compositor: ~A~%" compositor)))

#|
(defcallback compositor-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
;;(make-wl-compositor client-ptr 1 id))
(bind-wl-compositor client-ptr 1 id))
|#

#|
(defcallback compositor-bind :void
((client :pointer) (data :pointer) (version :uint32) (id :uint32))
(format t "Binding compositor~%")
(let ((resource (wl-resource-create client wl-compositor-interface 1 id)))
(wl-resource-set-implementation resource wl-compositor-implementation (null-pointer) (null-pointer))
))
|#
(make-wl-compositor client 1 id))
20 changes: 1 addition & 19 deletions wl-data-device-manager-impl.lisp
Expand Up @@ -18,22 +18,4 @@
())

(def-wl-bind device-manager-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((ddm (make-wl-data-device-manager client 1 id)))
(format t "Made data-device-manager: ~A~%" ddm)))

#|
(defcallback device-manager-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(bind-wl-data-device-manager client-ptr 1 id))
|#

#|
(defcallback device-manager-bind :void
((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(format t "Device manager bind~%")
(let ((device-manager (wl-resource-create client-ptr wl-data-device-manager-interface 1 id)))
(wl-resource-set-implementation
device-manager
wl-data-device-manager-implementation
(null-pointer)
(null-pointer))))
|#
(make-wl-data-device-manager client 1 id))
15 changes: 0 additions & 15 deletions wl-output-impl.lisp
Expand Up @@ -7,19 +7,4 @@

(def-wl-bind output-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((output (make-wl-output client 1 id :implementation? nil)))
;;(setf (->output *compositor*) output)
(format t "Made output: ~A~%" output)
(wl-output-send-geometry (->resource output) 0 0 1440 900 0 "apple" "apple" 0)))

#|
(defcallback output-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(let ((output (bind-wl-output client-ptr 1 id :implementation? nil)))
(wl-output-send-geometry output 0 0 1440 900 0 "apple" "apple" 0)))
|#

#|
(defcallback output-bind :void
((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(let ((output (wl-resource-create client-ptr wl-output-interface 1 id)))
(setf (->output *compositor*) output)))
|#
19 changes: 0 additions & 19 deletions wl-seat-impl.lisp
Expand Up @@ -19,24 +19,5 @@

(def-wl-bind seat-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((seat (make-wl-seat client 4 id)))
(format t "Made seat: ~A~%" seat)
(wl-seat-send-capabilities (->resource seat) 3)))

#|
(defcallback seat-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(let ((seat (bind-wl-seat client-ptr 4 id)))
(wl-seat-send-capabilities seat 3)))
|#

#|
(defcallback seat-bind :void
((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(format t "seat-bind called ~A~%" client-ptr)
(let ((seat (wl-resource-create client-ptr wl-seat-interface 4 id)))
(wl-resource-set-implementation
seat
wl-seat-implementation
(null-pointer)
(null-pointer))
(wl-seat-send-capabilities seat 3))) ;; WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD
|#
20 changes: 1 addition & 19 deletions wl-subcompositor-impl.lisp
Expand Up @@ -15,22 +15,4 @@
())

(def-wl-bind subcompositor-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((sbcmp (make-wl-subcompositor client 1 id)))
(format t "Made wl-subcompositor: ~A~%" sbcmp)))

#|
(defcallback subcompositor-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(bind-wl-subcompositor client-ptr 1 id))
|#

#|
(defcallback subcompositor-bind :void
((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(format t "subcompositor-bind called~%")
(let ((subcompositor (wl-resource-create client-ptr wl-subcompositor-interface 1 id)))
(wl-resource-set-implementation
subcompositor
wl-subcompositor-implementation
(null-pointer)
(null-pointer))))
|#
(make-wl-subcompositor client 1 id))
11 changes: 2 additions & 9 deletions xdg-shell-impl.lisp
Expand Up @@ -12,17 +12,10 @@
((:get-xdg-surface xdg-shell-get-xdg-surface))
())

#|
(defcallback client-delete :void ((client-ptr :pointer))
(remove-client (get-client client-ptr)))
|#
(def-wl-delete client-delete (xdg-shell)
(when xdg-shell
(format t "DELETING CLIENT~%")
(remove-client (->client (client xdg-shell)))
(setf (render-needed *compositor*) t))
)
(setf (render-needed *compositor*) t)))

(def-wl-bind xdg-shell-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((shell (make-xdg-shell client 1 id :delete-fn (callback client-delete))))
(format t "Made zxdg-shell: ~A~%" shell)))
(make-xdg-shell client 1 id :delete-fn (callback client-delete)))
28 changes: 2 additions & 26 deletions zxdg-shell-v6-impl.lisp
Expand Up @@ -11,34 +11,10 @@
((:get-xdg-surface get-xdg-surface))
())

#|
(defcallback client-delete :void ((client-ptr :pointer))
(remove-client (get-client client-ptr)))
|#
(def-wl-delete client-delete (zxdg-shell)
(when zxdg-shell
(format t "DELETING CLIENT~%")
(remove-client (->client (client zxdg-shell)))
(setf (render-needed *compositor*) t))
)
(setf (render-needed *compositor*) t)))

(def-wl-bind zxdg-shell-v6-bind (client (data :pointer) (version :uint32) (id :uint32))
(let ((shell (make-zxdg-shell-v6 client 1 id :delete-fn (callback client-delete))))
(format t "Made zxdg-shell: ~A~%" shell)))

#|
(defcallback zxdg-shell-v6-bind :void ((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(bind-zxdg-shell-v6 client-ptr 1 id :delete-fn (callback client-delete)))
|#

#|
(defcallback zxdg-shell-v6-bind :void
((client-ptr :pointer) (data :pointer) (version :uint32) (id :uint32))
(format t "zxdg-shell-bind called: ~A~%" client-ptr)
;;(waylisp:get-client client-ptr)
(wl-resource-set-implementation
(wl-resource-create client-ptr zxdg-shell-v6-interface 1 id)
zxdg-shell-v6-implementation
client-ptr
(callback client-delete)))
|#
(make-zxdg-shell-v6 client 1 id :delete-fn (callback client-delete)))
6 changes: 0 additions & 6 deletions zxdg-surface-v6-impl.lisp
Expand Up @@ -10,15 +10,9 @@
;; Save the wl-surface associated with the toplevel
(setf (wl-surface toplevel) (wl-surface zxdg-surface))
(push toplevel (surfaces (current-view *compositor*)))
#|
(with-wl-array array
(zxdg-toplevel-v6-send-configure (->resource toplevel) 0 0 array)
(zxdg-surface-v6-send-configure (->resource zxdg-surface) 0))))
|#
(let ((array (foreign-alloc '(:struct wl_array))))
(wl-array-init array)
(zxdg-toplevel-v6-send-configure (->resource toplevel) 0 0 array)
(zxdg-surface-v6-send-configure (->resource zxdg-surface) 0))))

(defimplementation zxdg-surface-v6 (isurface)
((:get-toplevel get-toplevel))
Expand Down
3 changes: 1 addition & 2 deletions zxdg-toplevel-v6-impl.lisp
Expand Up @@ -25,8 +25,7 @@
(defimplementation zxdg-toplevel-v6 (isurface ianimatable)
((:move move)
(:destroy zxdg-toplevel-destroy)
;; (:set-title set-title)
)
(:set-title set-title))
((zxdg-surface-v6 :accessor zxdg-surface-v6 :initarg :zxdg-surface-v6 :initform nil)))

(defmethod activate ((surface zxdg-toplevel-v6) active-surface mods)
Expand Down

0 comments on commit 4c23b8d

Please sign in to comment.