Skip to content

Commit e14bdfc

Browse files
authored
Bump to a version of SDL with patches for the TextInput / TextEditing (SDL 2.26.0) (kivy#2692)
* Testing: SDL with patches for the new TextInput / TextEditing * Bump to SDL 2.26.0
1 parent 63e6fb6 commit e14bdfc

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

pythonforandroid/bootstraps/sdl2/build/src/patches/SDLActivity.java.patch

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/src/main/java/org/libsdl/app/SDLActivity.java
22
+++ b/src/main/java/org/libsdl/app/SDLActivity.java
3-
@@ -225,6 +225,8 @@
3+
@@ -222,6 +222,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
44
// This is what SDL runs in. It invokes SDL_main(), eventually
55
protected static Thread mSDLThread;
66

@@ -9,7 +9,7 @@
99
protected static SDLGenericMotionListener_API12 getMotionListener() {
1010
if (mMotionListener == null) {
1111
if (Build.VERSION.SDK_INT >= 26) {
12-
@@ -323,6 +325,15 @@
12+
@@ -324,6 +326,15 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
1313
Log.v(TAG, "onCreate()");
1414
super.onCreate(savedInstanceState);
1515

@@ -25,7 +25,7 @@
2525
try {
2626
Thread.currentThread().setName("SDLActivity");
2727
} catch (Exception e) {
28-
@@ -824,7 +835,7 @@
28+
@@ -835,7 +846,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
2929
Handler commandHandler = new SDLCommandHandler();
3030

3131
// Send a message from the SDLMain thread
@@ -34,11 +34,11 @@
3434
Message msg = commandHandler.obtainMessage();
3535
msg.arg1 = command;
3636
msg.obj = data;
37-
@@ -1302,6 +1313,20 @@
37+
@@ -1384,6 +1395,20 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
3838
return SDLActivity.mSurface.getNativeSurface();
3939
}
4040

41-
+ /**
41+
+ /**
4242
+ * Calls turnActive() on singleton to keep loading screen active
4343
+ */
4444
+ public static void triggerAppConfirmedActive() {
@@ -55,21 +55,21 @@
5555
// Input
5656

5757
/**
58-
@@ -1795,7 +1820,7 @@
59-
}
58+
@@ -1878,6 +1903,7 @@ class SDLMain implements Runnable {
6059

6160
Log.v("SDL", "Running main function " + function + " from library " + library);
62-
-
61+
6362
+ SDLActivity.mSingleton.appConfirmedActive();
6463
SDLActivity.nativeRunMain(library, function, arguments);
6564

6665
Log.v("SDL", "Finished main function");
67-
@@ -2316,7 +2341,7 @@
66+
@@ -1935,8 +1961,7 @@ class DummyEdit extends View implements View.OnKeyListener {
6867
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
6968
ic = new SDLInputConnection(this, true);
7069

71-
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
72-
+ outAttrs.inputType = SDLActivity.keyboardInputType;
73-
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
74-
| EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
70+
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
71+
- InputType.TYPE_TEXT_FLAG_MULTI_LINE;
72+
+ outAttrs.inputType = SDLActivity.keyboardInputType | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
73+
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
74+
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
7575

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77

88
class LibSDL2Recipe(BootstrapNDKRecipe):
9-
version = "2.24.0"
9+
version = "2.26.0"
1010
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL2-{version}.tar.gz"
11-
md5sum = 'cf539ffe9e0dd6f943ac9de75fd2e56e'
11+
md5sum = '35bc58cfe41b8fb6c8e6646be26fa47e'
1212

1313
dir_name = 'SDL'
1414

15+
patches = ['remove-extra-include.patch']
16+
1517
depends = ['sdl2_image', 'sdl2_mixer', 'sdl2_ttf']
1618

1719
def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=True):
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Naur SDL.orig/Android.mk SDL/Android.mk
2+
--- SDL.orig/Android.mk 2022-11-22 07:41:32
3+
+++ SDL/Android.mk 2022-11-22 07:42:00
4+
@@ -12,7 +12,7 @@
5+
6+
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
7+
8+
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include
9+
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
10+
11+
LOCAL_SRC_FILES := \
12+
$(subst $(LOCAL_PATH)/,, \

0 commit comments

Comments
 (0)