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: basic demo on andorid has slight GUI race conditions bug #11804

Closed
ghost opened this issue Jul 21, 2015 · 4 comments
Closed

x/mobile: basic demo on andorid has slight GUI race conditions bug #11804

ghost opened this issue Jul 21, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Jul 21, 2015

golang.org/x/mobile/example/basic
its a UI interaction bug.

Context:
gedw99-MacBook-Pro:audio apple$ go version
go version go1.5beta2 darwin/amd64

gedw99-MacBook-Pro:audio apple$ which go
/usr/local/go/bin/go
gedw99-MacBook-Pro:audio apple$

Steps to reproduce:
compile for android
load apk on nexus 6
open program and it works fine.
hit home button
open program and it works fine
hit back button
open program and it shows a dithered triangle.

  • it looks like 2 programs running on top of each other with a alpha transparency between them.
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 21, 2015
@ianlancetaylor
Copy link
Contributor

CC @crawshaw

@crawshaw crawshaw self-assigned this Jul 21, 2015
@crawshaw
Copy link
Member

Thanks for the report. On a Galaxy Nexus I see some kind of crash for open->back button->open. This is probably a recent regression (due to our lack of good integration testing for apps). I'll take a look.

@rakyll rakyll changed the title gomobile: Basic demo on andorid has slight GUI race conditions bug x/mobile: basic demo on andorid has slight GUI race conditions bug Jul 21, 2015
@ghost
Copy link
Author

ghost commented Jul 21, 2015

happy to report it. thanks for your hard work.

In relation to what you get on the Galaxy Nexus, the crash is visual or on log files ? On nexus 6 the GUI does not crash, just has this weird dithering on the triangle. i did not check the logs.

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Aug 5, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
This CL fixes two bugs in the existing app implementation on android.
The first, is it assumed a single NativeActivity instance is created
per process. This is not true. If you open an app, hit the back
button, then open it again, the original activity is destroyed and a
new one is created. So only call main.main in the first onCreate.

The second bug has to do with window lifetimes. Previously we only
processed GL work while the window existed, as part of a paint cycle.
This missed GL events called as part of a lifecycle downgrade when
the window was destroyed. (I.e. the contents of onStop.) This CL
fixes this by making the main android event processing loop last for
the life of the process, not the window.

Fixes golang/go#11804.

Change-Id: Ia03e464aab5bc10ba75564b7ca11054515cda011
Reviewed-on: https://go-review.googlesource.com/12533
Reviewed-by: Nigel Tao <nigeltao@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
This CL fixes two bugs in the existing app implementation on android.
The first, is it assumed a single NativeActivity instance is created
per process. This is not true. If you open an app, hit the back
button, then open it again, the original activity is destroyed and a
new one is created. So only call main.main in the first onCreate.

The second bug has to do with window lifetimes. Previously we only
processed GL work while the window existed, as part of a paint cycle.
This missed GL events called as part of a lifecycle downgrade when
the window was destroyed. (I.e. the contents of onStop.) This CL
fixes this by making the main android event processing loop last for
the life of the process, not the window.

Fixes golang/go#11804.

Change-Id: Ia03e464aab5bc10ba75564b7ca11054515cda011
Reviewed-on: https://go-review.googlesource.com/12533
Reviewed-by: Nigel Tao <nigeltao@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

3 participants