-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix Outdated SDLActivity #1347
Fix Outdated SDLActivity #1347
Conversation
While updating the SDL2 recipe to version 2.0.4 in PR kivy#713, the SDLActivity was not updated accordingly. For example, SDL 2.0.4 expects the Activity to have a method called "openAPKExpansionInputStream" while this method was called "openAPKExtensionInputStream" in older versions. SDL2 is not able to read files when the method is missing. Also, text input is partly broken as it is not possible to enter a "space" character.
c2e9ac8
to
6f2302d
Compare
I am seeing spurious segfaults on app resume. I wonder if those are related? It would be interesting to see this merged and see if it makes those go away |
Maybe. Until it is merged, you can test it using my fork:
|
@@ -1063,7 +1111,43 @@ public void surfaceChanged(SurfaceHolder holder, | |||
mWidth = width; | |||
mHeight = height; | |||
SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate()); | |||
Log.v("SDL", "Window size:" + width + "x"+height); | |||
Log.v("SDL", "Window size: " + width + "x" + height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You used Log.v(TAG, ...) in most places now, but not here. Is that an oversight maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I did in this PR is just replacing the SDLActivity with the one that comes with SDL 2.0.4 and then merging some changes by the python-for-android team back in.
Here, the SDL guys dediced to not use the TAG
constant and to just keep the raw "SDL"
string. Don't ask me why :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha okay, that explains it. Well it's no biggie, it's not like the output prefix is vital. Just something that stumped me
This is superseded by #1528 (which updates both SDL2 and the SDLActivity + related .java classes to the latest 2.0.9 version) |
@krinnewitz is it ok if I close this for now? I'm pretty sure the more comprehensive SDL 2.0.9 version bump covers this and gets us to an even more recent thanks again for your work! sorry it was delayed so long that we didn't get this in before actually coming up with something newer |
Yes, perfectly fine. Having SDL 2.0.9 is even better! |
While updating the SDL2 recipe to version 2.0.4 in PR #713, the
SDLActivity was not updated accordingly.
For example, SDL 2.0.4 expects the Activity to have a method called
"openAPKExpansionInputStream" while this method was called
"openAPKExtensionInputStream" in older versions. SDL2 is not able to
read files when the method is missing.
This can result in multiple problems, e.g. segfaults. For example,
without this fix, you get NULL when loading a font using SDL2_ttf,
because SDL_RWFromFile needs openAPKExpansionInputStream.
Also, text input is partly broken as it is not possible to enter a
"space" character.
This PR replaces the SDLActivity with the one from SDL2-2.0.4 preserving the
adjustments that seem to be introduced by the python-for-android developers.