clojure-lanterna
clojure-lanterna copied to clipboard
Redraw writes green X's
I get a screen looking like the one below, when i try to run the following code:
(ns test.core
(:use lanterna.screen))
(defn main-loop [scr x y]
(redraw scr)
(let [k (get-key-blocking scr)]))
(defn main []
(let [scr (get-screen :swing)]
(in-screen scr
(main-loop scr 0 0))))
Any suggestions?
Did you resize the window at all? I sometimes saw that when I dragged the window to be bigger but Lanterna hadn't gotten around to updating its size...
Not on purpose, but XMonad probably makes it a certain size when it is started. If I make the window smaller, the X's disappear and the screen is properly black when enlarged.
I just tried to record what happens, but when running an ffmpeg recording session, the X's don't appear. Instead, here is an album that describes what is going on: http://imgur.com/a/3Q4Pz
Also, sometimes when i compile, i hardly get the behavior at all, other times only once in a while, and some times it happens all the time, even though the code is the same (like if i remove some comments or some other unrelated defns). Maybe some timing issues with XMonads resizing and lanternas detection of screen size?
I had the same issue, runnig i3, also a tiling manager.
I found a workaround that seems to work:
(s/start-screen scr)
(s/get-key scr)
(s/redraw scr)
(after that, the correct screen size is determined.
Same problem here with awesome wm (yes, a tiling WM) - but my tests make me assume it's rather an issue in screen resizing in general. Will revisit / test / solve? for 0.10.0.
@fhennig, thank you very much for workaround, it was just what I needed, it worked for me! Much appreciated!