racket-gui-easy icon indicating copy to clipboard operation
racket-gui-easy copied to clipboard

Buggy sliders on macos when throttling

Open shunlog opened this issue 5 months ago • 12 comments

Hi, thanks for the nice lib!

I noticed that sliders on macos are buggy when throttling is involved. It works fine on windows and linux however.

Here is a demo:

https://github.com/user-attachments/assets/678ccf69-69d8-4a3b-92f8-0e17c56772a7

#lang racket/base

(require racket/gui/easy
         racket/gui/easy/operator)

(define @a (@ 0))
(define @b (@ 0))
(define @b2 (obs-throttle @b))

(render
 (window
  (hpanel
   (text "Slider on @a")
   (slider @a #:min-value 0 #:max-value 100
           (λ (v) (:= @a v)))
   (text (obs-map @a number->string)))

  (hpanel
   (text "Slider on @b")
   (slider @b #:min-value 0 #:max-value 100
           (λ (v) (:= @b v)))
   (text (obs-map @b number->string))
   (text (obs-map @b2 number->string)))
  
  (hpanel
   (text "Slider on throttled @b")
   (slider @b2 #:min-value 0 #:max-value 100
           (λ (v) (:= @b v)))
   (text (obs-map @b number->string))
   (text (obs-map @b2 number->string)))
  ))

When the slider value is the throttled observable, there is only 1 bug: the observable value is not updated during sliding.

On the other hand, when the slider value is the original observable, there is one additional bug: the value is set to where the cursor started sliding.

shunlog avatar Aug 12 '25 11:08 shunlog