Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl-SDL2 appears to block SLIME/swank updates in event loop #141

Open
fouric opened this issue May 24, 2021 · 0 comments
Open

cl-SDL2 appears to block SLIME/swank updates in event loop #141

fouric opened this issue May 24, 2021 · 0 comments

Comments

@fouric
Copy link

fouric commented May 24, 2021

The function swank::handle-requests appears to become non-functional in an SDL2 event loop. Example code:

(defun test ()
  (sdl2:with-init (:everything)
    (sdl2:with-window (window)
      (sdl2:with-renderer (renderer window :flags '(:presentvsync))
        (sdl2:with-event-loop (:method :poll)
          (:idle ()
                 (let ((connection (or swank::*emacs-connection* (swank::default-connection))))
                   (when connection
                     (swank::handle-requests connection t)))
                 (sdl2:set-render-draw-color renderer 0 0 0 255)
                 (sdl2:render-clear renderer)
                 (sdl2:render-present renderer))
          (:quit () t))))))

In the above code, the SLIME REPL does not update while the SDL2 event loop is running. When I run another loop in the same image that does not invoke the SDL2 event loop, the SLIME REPL updates successfully:

```lisp
(defun test-2 ()
  (dotimes (i 10)
    (sleep 1)
    (let ((connection (or swank::*emacs-connection* (swank::default-connection))))
      (when connection
        (swank::handle-requests connection t))))
  (princ "done"))

Environment:
`sbcl --version`: SBCL 2.0.1.debian
`uname -a`: Linux monolith 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
emacs `version`: GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
cl-sdl2 version: cl-sdl2-20201220-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant