                                                {:type :click :button button :col col :row row :group-id group-id})
                                              (clojure.set/intersection
                                                new-group-locations
-                                               (apply group-locations group-map group->font-texture @mousedown-xy)))
+                                               (apply group-locations group-map group->font-texture
+                                                      framebuffer-width framebuffer-height @mousedown-xy)))
                                         false)))))
         cursor-pos-callback   (proxy [GLFWCursorPosCallback] []
                                 (invoke [window xpos ypos]
-                                  (let [new-group-locations (group-locations group-map group->font-texture xpos ypos)
-                                        old-group-locations (apply group-locations group-map group->font-texture @mouse-xy)
+                                  (let [new-group-locations (group-locations group-map group->font-texture
+                                                                             framebuffer-width framebuffer-height
+                                                                             xpos ypos)
+                                        old-group-locations (apply group-locations group-map group->font-texture
+                                                                   framebuffer-width framebuffer-height @mouse-xy)
                                         entered-locations   (clojure.set/difference new-group-locations old-group-locations)
                                         left-locations      (clojure.set/difference old-group-locations new-group-locations)]
                                     (reset! mouse-xy [xpos ypos])

    @destroyed))

(defn group-locations
  ([_ _]
   [])
  ([group-map group->font-texture xpos ypos]
   (set
     (remove (fn [[group-id col row]] (and (nil? col) (nil? row)))
             (map (fn [[group-id group]]
                    (let [{:keys [pos columns rows]
                           [pos-x pos-y] :pos} @group
                          {:keys [character-width character-height]} (-> group->font-texture group-id deref)]
                      ;; determine if the mouse is in the bounds of the layer group
                      (when (and (<= pos-x xpos (+ (* columns character-width) pos-x))
                               (<= pos-y ypos (+ (* rows character-height) pos-y)))
                        ;; determine which col/row the mouse is in the group
                        (let [col (int (quot (- xpos pos-x) character-width))
                              row (int (quot (- ypos pos-y) character-height))]
                          [group-id col row]))))
                   group-map)))))


                                  (let [state  (condp = (int action)
                                                 GLFW/GLFW_PRESS :mouse-down
                                                 GLFW/GLFW_RELEASE :mouse-up)
                                        new-group-locations (apply group-locations group-map group->font-texture
                                                                   framebuffer-width framebuffer-height @mouse-xy)
                                        button (get [:left :right :middle] (int button))]
                                    (async/onto-chan
                                      term-chan
