dkochmanski / clim-tos

The Common Lisp Interface Manager
http://www.cliki.net/CLIM
Other
1 stars 0 forks source link

"null" glitch when pressing backspace #1

Open dkochmanski opened 6 years ago

dkochmanski commented 6 years ago

https://gitlab.common-lisp.net/mcclim/gramps-clim2/issues/34

After applying fix for https://gitlab.common-lisp.net/mcclim/gramps-clim2/issues/33 string is replayed OK, but null glitch appears (after first hit of "backspace"):

obraz

dkochmanski commented 6 years ago

https://www.bountysource.com/issues/56192855-null-glitch-when-pressing-backspace

picospuch commented 6 years ago

Hi @dkochmanski, I can't reproduce the glitch, the demo works fine on the macos. But I think it may help to clear the input stream before the loop starts. Try this and hope it helps:

diff --git a/demo/listener.lisp b/demo/listener.lisp
index 54edbe42..3ba9bc21 100644
--- a/demo/listener.lisp
+++ b/demo/listener.lisp
@@ -137,6 +137,7 @@
     (let* ((abort-gestures *abort-gestures*)
            (*abort-gestures* nil))
       ;;--- What test does this need?
+      (clear-input stream)
       (when (member (stream-read-gesture stream :timeout 0 :peek-p t) abort-gestures)
         (stream-read-gesture stream :timeout 0)))
     (fresh-line stream)