8000 fixes for #890 (deadlock on pause/resume with pyjnius/pygame) by hottwaj · Pull Request #892 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

fixes for #890 (deadlock on pause/resume with pyjnius/pygame) #892

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

Closed
wants to merge 1 commit into from

Conversation

hottwaj
Copy link
Contributor
@hottwaj hottwaj commented Sep 25, 2016

Moved java LayoutListener logic out of 'android' package into pygame bootstrap

This avoids deadlock due to LayoutListener locking python thread with pyjnius when app onPause/onResume occurs

Moved java LayoutListener logic out of 'android' package into pygame bootstrap

This avoids deadlock due to LayoutListener locking python thread with pyjnius when app onPause/onResume occurs
@inclement
Copy link
Member

Looks good I think, but I'm just making sure I understand the change.

@akshayaurora akshayaurora self-assigned this Oct 20, 2016
@akshayaurora
Copy link
Member

@hottwaj the layout listener is duplicate for PyGame so you actually do not need to add it back in.

It just needs to be removed from android.pyx

This fix here #911

Works on both the pygame and the sdl2 backend.

@hottwaj
Copy link
Contributor Author
hottwaj commented Oct 22, 2016

Hey @akshayaurora, that does look like it will solve the deadlock issue as it avoids a callback to python from the java thread (I haven't tested) that could be called when the app is paused.

It looks like your method does more work on each call to get_keyboard_height(), whereas the layout listener i moved into Java code in dbccfe6 is reactive - it only does work when the global layout changes

I assumed that the "reactive"-ness property was why the code in android.pyx was set up with the LayoutListener logic in the first place, though I don't know how often get_keyboard_height() is called and whether performance is actually an issue

In summary, as long as the deadlock issue is solved and performance is not affected I'm happy with either solution!

Cheers & thanks for taking a look at this.

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

Successfully merging this pull request may close these issues.

3 participants
0