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

Bump to a version of SDL with patches for the TextInput / TextEditing (SDL 2.26.0) #2692

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

misl6
Copy link
Member

@misl6 misl6 commented Oct 22, 2022

This is a WIP PR meant for testing a pre-release SDL feature that should fix the following issues:

Edit:
SDL 2.26.0 has been released, and even if it needs a small patch during build-time, works great!
The SDL team said that 2.26.1 (which doesn't need remove-extra-include.patch anymore) is expected to be released in a month.

But, considering that we're not targeting anymore a pre-release version, this PR could be considered ready to merge.

@brvier
Copy link
Contributor

brvier commented Oct 22, 2022

Indeed works really well !

@misl6
Copy link
Member Author

misl6 commented Oct 23, 2022

Test results:

  • GBoard + Android emulator (Android 13): ✅
  • GBoard + Samsung s10e (Android 12): ✅
  • Samsung Keyboard + Samsung s10e (Android 12): ✅
Screen.Recording.2022-10-23.at.15.20.47.mov

@mp-007
Copy link
Contributor

mp-007 commented Nov 3, 2022

@mis16 You should upgrade to 2.24.2. It also included a lot of joystick stuff and some opengl fixes. Maybe you can rename this PR with some additional fixes included in the last SDL release version.

commit 'a905a7869f18332579ff06ba3f7f3777708a3007' is also included (libsdl-org/SDL@release-2.24.2...main)

@misl6
Copy link
Member Author

misl6 commented Nov 4, 2022

Hi @mp-007!

SDL2 release 2.24.2 does not contain all the features and fixes available on the main branch.

Only specific commits (mainly bugfixes) from the main branch are backported to the 2.24.x branch.

See: libsdl-org/SDL@release-2.24.0...release-2.24.2 and libsdl-org/SDL@release-2.24.0...main

The fixes ( and features ) which are needed for the TextEditing with suggestions / IME are not included into the 2.24.x series.

@mp-007
Copy link
Contributor

mp-007 commented Nov 4, 2022

sorry my bad. I was checking at the wrong place....
I think will have to wait SDL version 2.25.0

@misl6
Copy link
Member Author

misl6 commented Nov 4, 2022

I think will have to wait SDL version 2.25.0

Not necessarily, we can target a specific commit into the history or add a patch.
Feel free to open a separate issue on kivy/python-for-android, so we can keep track of it.

@mp-007
Copy link
Contributor

mp-007 commented Nov 4, 2022

ok thanks for your time @misl6

For now, I didn't see a specific commit that included all the things I need to fix the open gl es 2 compilation. If I find something I will maybe do a new PR.

@mp-007
Copy link
Contributor

mp-007 commented Nov 18, 2022

new sdl2 pre-release is out https://github.com/libsdl-org/SDL/releases/tag/prerelease-2.25.1.
Maybe this PR can be updated to this release. It look like it include your feature need for this PR.

@misl6
Copy link
Member Author

misl6 commented Nov 20, 2022

@mp-007 FYI:
Tried locally before launching it on the CI pipeline, but that issue is preventing us to do so: libsdl-org/SDL#6558

@OrangMutan
Copy link

OrangMutan commented Nov 23, 2022

Hi, my app is suffering from the problems with the TextInput-bug (backspace + doubling of characters). As far as I understand this can be solved by applying a sdl-patch. Since my app is only for android the problem with libsdl-org/SDL/issues/6558 doesn't concern. Can you please advice me, how to install that patch? Is it a certain adjustment in buildozer.spec?

@brvier
Copy link
Contributor

brvier commented Nov 24, 2022

Until available in main repository, you can directly use in bulldozer :

# (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy)
p4a.fork = misl6
# (str) python-for-android branch to use, defaults to master
p4a.branch = fix/android-IME

@misl6 misl6 changed the title [WIP] Bump to a version of SDL with patches for the TextInput / TextEditing Bump to a version of SDL with patches for the TextInput / TextEditing (SDL 2.26.0) Nov 27, 2022
@misl6 misl6 requested a review from AndreMiras November 27, 2022 08:57
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@OrangMutan
Copy link

OrangMutan commented Nov 28, 2022

thx brvier for your tip, but when I applied these changes to buildozer.spec building failed:

FAILURE: Build failed with an exception.
 What went wrong: Execution failed for task ':processReleaseMainManifest'.

Since misl6 apparently has changed something in between, I give it a new try ...

@OrangMutan
Copy link

No - it doesn't work out - while building same error as above and later on:

[INFO]:    COMMAND:
cd /mnt/c/.../PycharmProjects/waldi_III/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/waldi3 && /mnt/c/.../PycharmProjects/waldi_III/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/waldi3/gradlew clean bundleRelease
[WARNING]: ERROR: /mnt/c/.../PycharmProjects/waldi_III/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/waldi3/gradlew failed!

Is there anything else what is to be considered, if I want to use

p4a.fork = misl6
p4a.branch = fix/android-IME

?

@misl6 misl6 merged commit e14bdfc into kivy:develop Nov 28, 2022
@misl6
Copy link
Member Author

misl6 commented Nov 28, 2022

Hi @OrangMutan !

The PR has now been merged into develop 😀

(Feel free to reach us on Discord support chat if you need some help)

@antorix
Copy link

antorix commented Nov 29, 2022

Dear @misl6, I just did:

p4a.fork = misl6
p4a.branch = fix/android-IME

Everything compiled fine, but the suggestions problem is still there: they are all garbled. What did I miss? You mentioned the develop channel. Can you give me a hint how I can use it? Sorry for dummy questions.

@OrangMutan
Copy link

Hello @misl6! Sounds good, so I did a
buildozer android clean
set p4a.fork back to default,
p4a.branch = develop and afterwards
buildozer -v android release
Should it work like this?
But it doesn't - same build errors like before.
Building process is running fine, if I set p4a.branch = master.
If this is how it should work, than I surely change to Discord support chat - probably easier to find a solution then ...

@mp-007
Copy link
Contributor

mp-007 commented Nov 29, 2022

@OrangMutan have you checked that gradlew failed. Or maybe you can send the buildozer.spec file (better to ask on discord)

https://kivy.org/doc/stable/contact.html#discord

@antorix
Copy link

antorix commented Nov 29, 2022

Where is the Discord mentioned?

@mp-007
Copy link
Contributor

mp-007 commented Nov 29, 2022

see link in my comment

@Azag3077
Copy link

Azag3077 commented Dec 2, 2022

@misl6 kudos to you. However there's one more thing I think needs to be fixed. Actually two.

First, the keyboard ought to start with an upper case.
Secondly, input_type: "null" seems to have lost its functionality. The keyboard suggestions can't be turned off because of this.

I am not so sure about this last issue if it related to this post but I need to say it. Ever since I used this particular branch of p4a, my app keeps switching to landscape mode anytime I rotate my device despite the fact that I set the screen orientation to portrait.

@brvier
Copy link
Contributor

brvier commented Dec 2, 2022

Uppercase is the normal behavior of the keyboard, depending on keyboard preference of course.

Didn't have any strange behavior with rotation here.

And input_type null on Android should have suggestion.

@brvier
Copy link
Contributor

brvier commented Dec 2, 2022

keyboard_suggestions: False
Should be what you re looking for.

But I suggest to let user decide such thing.

@antorix
Copy link

antorix commented Dec 3, 2022

But I suggest to let user decide such thing.

Please, do you mean keyboard suggestions are working fine for you in Kivy? No garbled words and repetitions? If yes, which keyboard do you use and did you build from some develop/pre-release branch of anything? In my Kivy 2.1.0, no keyboard is working normally and I just have to disable keyboard suggestions altogether.

@Azag3077
Copy link

Azag3077 commented Dec 3, 2022

Uppercase is the normal behavior of the keyboard, depending on keyboard preference of course.

Didn't have any strange behavior with rotation here.

And input_type null on Android should have suggestion.

What I mean is when you open a keyboard, the letters should be in uppercases. Just like when you want to start a sentence, you make the first letter of the first word in the sentence capital letter.

If you still don't get me, look at the video you uploaded....you had to press the "cap" button before typing.

@antorix
Copy link

antorix commented Dec 3, 2022

I got you now, thanks

@Azag3077
Copy link

Azag3077 commented Dec 3, 2022

keyboard_suggestions: False Should be what you re looking for.

But I suggest to let user decide such thing.

There's a password textinput in my app and I don't want the suggestions at the top of the keyboard. But setting keyboard suggestions to False and input_type to null isn't hiding the keyboard suggestions.

@antorix
Copy link

antorix commented Dec 3, 2022

Do you (or anybody else here) by chance know how to fix the keyboard suggestions problem right now? Or this is impossible and we just need to wait for the new SDL and/or p4a version?

@Azag3077
Copy link

Azag3077 commented Dec 3, 2022

But I suggest to let user decide such thing.

Please, do you mean keyboard suggestions are working fine for you in Kivy? No garbled words and repetitions? If yes, which keyboard do you use and did you build from some develop/pre-release branch of anything? In my Kivy 2.1.0, no keyboard is working normally and I just have to disable keyboard suggestions altogether.

Yes, the fix is in this PR and it has been successfully merge. To use, set the p4a.branch in your spec file to develop.
You may have to clean your buildozer directory.
buildozer android clean

@antorix
Copy link

antorix commented Dec 3, 2022

(str) python-for-android specific commit to use, defaults to HEAD, must be within

#p4a.commit = HEAD

Do you mean this string? If yes, can you please tell me what exactly should be in it?

@Azag3077
Copy link

Azag3077 commented Dec 3, 2022

#p4a.commit = HEAD```

Do you mean this string? If yes, can you please tell me what exactly should be in it?

Nope

p4a.branch = develop

@antorix
Copy link

antorix commented Dec 3, 2022

ahh… yes I did this a few days ago. It's exactly "p4a.branch = develop". But nothing changed for me.

@antorix
Copy link

antorix commented Dec 3, 2022

but I will try to clean the buildozer directory now

@Azag3077
Copy link

Azag3077 commented Dec 3, 2022

ahh… yes I did this a few days ago. It's exactly "p4a.branch = develop". But nothing changed for me.

Oops!!!.

Here is what I did before it was merged.

p4a.url = https://github.com/misl6/python-for-android.git
p4a.branch = fix/android-IME

And now that it is merged I expected it to be in developing branch and using spec below only should work.

p4a.branch = develop

@antorix
Copy link

antorix commented Dec 3, 2022

Thanks, it worked! 3 out of 4 keyboards I'm testing work fine. But now another question remains: why is my favorite Microsoft SwiftKey keyboard still now working? I mean no keyboard suggestions.

@Aravind0007
Copy link

Hi everyone, I have some blockers similar to this issue in backspace functionality and keyboard suggestions. We already had discussion in google groups kivy user support. Please find the discussion link here : https://groups.google.com/g/kivy-users/c/yQIuLZPf-jg/m/Be6maQTOCwAJ?utm_medium=email&utm_source=footer . If it's a user code issue, Please guide me how to resolve this. Let me know if it's a kivy platform code issue and if you need anything else from my side :)

@Aravind0007
Copy link

Aravind0007 commented Dec 10, 2022

shyamnathp pushed a commit to shyamnathp/python-for-android that referenced this pull request Feb 17, 2023
…ng (SDL `2.26.0`) (kivy#2692)

* Testing: SDL with patches for the new TextInput / TextEditing

* Bump to SDL 2.26.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants