Skip to content

Commit

Permalink
FranzCross,mixin: fixup mix-context-event on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Oct 13, 2023
1 parent ec9f83e commit 7f408ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FranzCross/mixin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@
(define item-height
(quotient
(send receiver get-height)
(add1 (send receiver number-of-visible-items))))
(case (system-type 'os)
[(unix) (send receiver number-of-visible-items)]
[else (add1 (send receiver number-of-visible-items))])))
(define y-pos
(let ([y (send event get-y)])
(case (system-type 'os)
[(windows) ;; does not include scroll offset
[(unix windows) ;; does not include scroll offset
(+ y (* item-height (send receiver get-first-visible-item)))]
[else y])))
(define item-index
(let* ([index (quotient y-pos item-height)]
[index (case (system-type 'os)
[(macosx) index] ;; the first non-header row has y=0
[(macosx unix) index] ;; the first non-header row has y=0
[else (sub1 index)])])
(and (< index (send receiver get-number)) index)))
(begin0 item-index
Expand Down

0 comments on commit 7f408ec

Please sign in to comment.