More efficient SDL_IsScreenKeyboardShown() implementation

This commit is contained in:
pelya
2012-12-15 16:20:15 +02:00
parent 49054ab019
commit 7065fadf88
5 changed files with 31 additions and 17 deletions

View File

@@ -832,7 +832,7 @@ JNIEXPORT void JNICALL
JAVA_EXPORT_NAME(DemoRenderer_nativeTextInputFinished) ( JNIEnv* env, jobject thiz )
{
textInputBuffer = NULL;
SDL_ANDROID_TextInputFinished();
SDL_ANDROID_TextInputFinished = 1;
}
static void updateOrientation ( float accX, float accY, float accZ );
@@ -1943,6 +1943,14 @@ void SDL_ANDROID_DeferredTextInput()
if( isMouseUsed )
SDL_ANDROID_MainThreadPushMouseMotion(currentMouseX + (currentMouseX % 2 ? -1 : 1), currentMouseY); // Force screen redraw
}
else
{
if( SDL_ANDROID_TextInputFinished )
{
SDL_ANDROID_TextInputFinished = 0;
SDL_ANDROID_IsScreenKeyboardShownFlag = 0;
}
}
SDL_mutexV(deferredTextMutex);
};