x/exp/shiny: MacOS driver does not fire mousewheel events with single or slow clicks #16152
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Milestone
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6.2 darwin/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/driusan/Code/Go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Ran x/exp/shiny/example/basic, scrolled mouse a single click with the scroll wheel on a mouse
Output similar to:
got mouse.Event{X:824, Y:452, Button:-1, Modifiers:0x0, Direction:0x0}
in the console.
Nothing.
Adding some debug statements, it seems that the issue is that this line:
for delta := int(dy); delta != 0; delta--
in
driver/gldriver/cocoa.go:/func mouseEvent/
isn't iterating at all when dy < 1 and the conversion is rounding to 0 when it casts to an int.Changing it to:
for delta := int(math.Ceil(float64(dy))); delta != 0; delta--
if a little inelegant, fixed the issue for me.
The text was updated successfully, but these errors were encountered: