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: X11 events freeze when not constantly redrawing #38632

Open
bergwerf opened this issue Apr 23, 2020 · 2 comments
Open

x/mobile: X11 events freeze when not constantly redrawing #38632

bergwerf opened this issue Apr 23, 2020 · 2 comments

Comments

@bergwerf
Copy link

@bergwerf bergwerf commented Apr 23, 2020

go version go1.13.5 linux/amd64

This issue only happens on X11 and not Android. I want to a.Send(paint.Event{}) only when an update is needed, but if I do this other events do not come through. After some debugging I found that this is because Publish() unblocks the select statement and runs C.processEvents(). So if no publish is happening, then X11 events are not checked. See: https://github.com/golang/mobile/blob/master/app/x11.go#L63

I think C.processEvents() should happen in a separate goroutine (unless a more lightweight solution is possible).

@gopherbot gopherbot added this to the Unreleased milestone Apr 23, 2020
@gopherbot gopherbot added the mobile label Apr 23, 2020
@bergwerf
Copy link
Author

@bergwerf bergwerf commented Apr 23, 2020

Indeed adding this fixes the issue.

go func() {
	for {
		C.processEvents()
	}
}()

Perhaps one of the authors can look at this and decide if this can be added.

@andybons
Copy link
Member

@andybons andybons commented Apr 24, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.