        (Display/setDisplayMode (DisplayMode. screen-width screen-height))
        (Display/setTitle title)
        (when icon-array
-         (Display/setIcon icon-array))
+         (log/info "Setting icons")
+         (Display/setIcon icon-array)
+         (Thread/sleep 100))
        (Display/create pixel-format context-attributes)
        (Keyboard/create)
        (Mouse/create)

                             (.withProfileCore true))
        icon-array         (when icon-paths
                             (condp = (LWJGLUtil/getPlatform)
                               LWJGLUtil/PLATFORM_LINUX (let [icon-array ^"[Ljava.nio.ByteBuffer;" (make-array ByteBuffer 1)
                                                              data ^bytes (png-bytes (get icon-paths 1))]
                                                          (aset icon-array 0 data)
                                                          icon-array)
                               LWJGLUtil/PLATFORM_MACOSX  (let [icon-array ^"[Ljava.nio.ByteBuffer;" (make-array ByteBuffer 1)
                                                                data ^bytes (png-bytes (get icon-paths 2))]
                                                            (aset icon-array 0 data)
                                                            icon-array)
                               LWJGLUtil/PLATFORM_WINDOWS (let [icon-array ^"[Ljava.nio.ByteBuffer;" (make-array ByteBuffer 2)
                                                                data0 ^bytes (png-bytes (get icon-paths 0))
                                                                data1 ^bytes (png-bytes (get icon-paths 1))]
                                                            (aset icon-array 0 data0)
                                                            (aset icon-array 1 data1)
                                                            icon-array)))
        latch              (java.util.concurrent.CountDownLatch. 1)]
     ;; init-natives must be called before the Display is created
     (init-natives)

          (loop-with-index col [c line]
            (let [chr        (or (get c :fx-character) (get c :character))
                  chr        (if (and (= layer-id base-layer-id)
                                      (char? chr)
                                      (= (char chr) (char 0)))
                                 \space
                                 chr)
                  highlight  (= @cursor-xy [col (- rows row 1)])
