Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/exp/shiny: MacOS driver does not fire mousewheel events with single or slow clicks #16152

Open
driusan opened this issue Jun 22, 2016 · 0 comments

Comments

@driusan
Copy link

commented Jun 22, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go version go1.6.2 darwin/amd64

  1. What operating system and processor architecture are you using (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"
  2. What did you do?
    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

  1. What did you expect to see?

Output similar to:

got mouse.Event{X:824, Y:452, Button:-1, Modifiers:0x0, Direction:0x0}

in the console.

  1. What did you see instead?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.