Skip to content

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

Closed
JonAnCla wants to merge 1 commit intokivy:masterfrom
JonAnCla:master
Closed

fixes for #890 (deadlock on pause/resume with pyjnius/pygame)#892
JonAnCla wants to merge 1 commit intokivy:masterfrom
JonAnCla:master

Conversation

@JonAnCla
Copy link
Contributor

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.

@JonAnCla
Copy link
Contributor Author

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