clojure-lanterna icon indicating copy to clipboard operation
clojure-lanterna copied to clipboard

Redraw writes green X's

Open Munksgaard opened this issue 11 years ago • 5 comments

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))))

screen-0

Any suggestions?

Munksgaard avatar Jul 11 '13 12:07 Munksgaard

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...

sjl avatar Jul 11 '13 15:07 sjl

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?

Munksgaard avatar Jul 11 '13 16:07 Munksgaard

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.

fhennig avatar Feb 07 '15 15:02 fhennig

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.

Martin-S-Weber avatar Jan 24 '17 13:01 Martin-S-Weber

@fhennig, thank you very much for workaround, it was just what I needed, it worked for me! Much appreciated!

postboy avatar Feb 18 '24 18:02 postboy