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/mobile/app: panic with palm touch on iOS app #13435

Closed
nobonobo opened this issue Nov 30, 2015 · 7 comments
Closed

x/mobile/app: panic with palm touch on iOS app #13435

nobonobo opened this issue Nov 30, 2015 · 7 comments

Comments

@nobonobo
Copy link

golang 1.5.1

https://github.com/golang/mobile/blob/master/app/darwin_armx.go#L151

panic: out of touchIDs
@hyangah hyangah added this to the Unreleased milestone Dec 1, 2015
@hyangah hyangah changed the title x/mobile/app/darwin_armx.go: I get panic when palm touch on iOS app x/mobile/app: panic with palm touch on iOS app Dec 1, 2015
@hyangah
Copy link
Contributor

hyangah commented Dec 1, 2015

/cc @crawshaw Is the following comment no longer true?

// It is widely reported that the iPhone can handle up to 5 simultaneous
// touch events, while the iPad can handle 11.

@nobonobo
Copy link
Author

nobonobo commented Dec 5, 2015

patch & log

diff --git a/app/darwin_armx.go b/app/darwin_armx.go
index 5344e27..f6fa027 100644
--- a/app/darwin_armx.go
+++ b/app/darwin_armx.go
@@ -132,6 +132,7 @@ var touchEvents struct {

 //export sendTouch
 func sendTouch(cTouch, cTouchType uintptr, x, y float32) {
+       log.Println(cTouch, cTouchType, x, y)
        id := -1
        for i, val := range touchIDs {
                if val == cTouch {
2015/12/05 22:25:26 5601104144 0 149 62
2015/12/05 22:25:26 5602228320 0 832 231
2015/12/05 22:25:26 5601879616 0 1090 337
2015/12/05 22:25:26 5601973040 0 428 117
2015/12/05 22:25:35 5601128704 0 239 91
2015/12/05 22:25:35 5601104144 0 299 612
2015/12/05 22:25:35 5601118880 0 990 122
2015/12/05 22:25:35 5601111664 0 619 133
2015/12/05 22:25:35 5601092240 0 603 327
2015/12/05 22:25:35 5601077024 0 817 107
2015/12/05 22:25:35 5601860816 0 560 597
2015/12/05 22:25:37 5602222480 0 656 160
2015/12/05 22:25:37 5602223728 0 583 597
panic: out of touchIDs

device: iPhone5s
iOS: 9.1(13B143)

@nobonobo
Copy link
Author

nobonobo commented Dec 7, 2015

6 fingers touch and release on iPhone5S.

expect:

  • 6 touch.TypeBegin events receive.
  • 6 touch.TypeEnd events receive.

instead:

  • 6 touch.TypeBegin events receive.
  • These touch.TypeEnd events disappeared.

No problem if less than 6 fingers.

@nobonobo
Copy link
Author

nobonobo commented Dec 8, 2015

need handle touchesCancelled ?

@gopherbot
Copy link

CL https://golang.org/cl/18180 mentions this issue.

@nobonobo
Copy link
Author

No occur panic in Android, but there was a problem of lost touch sequence (similar IOS).
cancel-events must handle for real-device.

  • AMOTION_EVENT_ACTION_CANCEL for android
  • touchesCancelled for iOS

Proposal:

  • Add const value "TypeCancel" to "event/touch/touch.go".
  • cancel-event send to app.
  • touchIDs delete cancelled ID for iOS

@crawshaw
Copy link
Member

crawshaw commented Jan 7, 2016

@nobonobo I missed your comment before submitting your CL. Want to move this to #13859?

@golang golang locked and limited conversation to collaborators Jan 7, 2017
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
improved a problem that continues to maintain a touch-ID
that must be discarded by 'touchesCanceled' event.

Fixes golang/go#13435

Change-Id: I13635255e5317bba2202bf7a8d2dd957f7824d0a
Reviewed-on: https://go-review.googlesource.com/18180
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
improved a problem that continues to maintain a touch-ID
that must be discarded by 'touchesCanceled' event.

Fixes golang/go#13435

Change-Id: I13635255e5317bba2202bf7a8d2dd957f7824d0a
Reviewed-on: https://go-review.googlesource.com/18180
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants