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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/src/main/java/org/libsdl/app/SDLActivity.java
@@ -225,6 +225,8 @@
@@ -222,6 +222,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
// This is what SDL runs in. It invokes SDL_main(), eventually
protected static Thread mSDLThread;

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

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

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

+ /**
+ /**
+ * Calls turnActive() on singleton to keep loading screen active
+ */
+ public static void triggerAppConfirmedActive() {
Expand All @@ -55,21 +55,21 @@
// Input

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

Log.v("SDL", "Running main function " + function + " from library " + library);
-
+ SDLActivity.mSingleton.appConfirmedActive();
SDLActivity.nativeRunMain(library, function, arguments);

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

- outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
+ outAttrs.inputType = SDLActivity.keyboardInputType;
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
| EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
- outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
- InputType.TYPE_TEXT_FLAG_MULTI_LINE;
+ outAttrs.inputType = SDLActivity.keyboardInputType | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;

6 changes: 4 additions & 2 deletions pythonforandroid/recipes/sdl2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@


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

dir_name = 'SDL'

patches = ['remove-extra-include.patch']

depends = ['sdl2_image', 'sdl2_mixer', 'sdl2_ttf']

def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=True):
Expand Down
12 changes: 12 additions & 0 deletions pythonforandroid/recipes/sdl2/remove-extra-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Naur SDL.orig/Android.mk SDL/Android.mk
--- SDL.orig/Android.mk 2022-11-22 07:41:32
+++ SDL/Android.mk 2022-11-22 07:42:00
@@ -12,7 +12,7 @@

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \