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

Closed
bergwerf opened this issue Apr 23, 2020 · 3 comments
Closed

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

bergwerf opened this issue Apr 23, 2020 · 3 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bergwerf
Copy link

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 Android, iOS, and x/mobile label Apr 23, 2020
@bergwerf
Copy link
Author

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 andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 24, 2020
@andybons
Copy link
Member

@hyangah

@changkun
Copy link
Member

Separating the event processing loop into a different goroutine is potentially problematic and may cause frame buffer race when handling window resizing and sometimes even cause the app crash. Close because I don't think we could do much here yet. The current design works as intended. If there are any further discussions on this, feel free to comment.

@golang golang locked and limited conversation to collaborators Mar 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants