From d83ac9ebfcd60d411374cabad2ac160eb99db479 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 27 Apr 2026 10:06:00 -0700
Subject: [PATCH] testime: use the correct properties when enabling text input
(cherry picked from commit 6f952a8e636b8c3173075ddf1fd9458489adedf3)
---
test/testime.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/testime.c b/test/testime.c
index e2945a2cf3081..cd09d6ddd10a2 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -474,7 +474,7 @@ static void InitInput(WindowState *ctx)
{
/* Prepare a rect for text input */
ctx->textRect.x = 100.0f;
- ctx->textRect.y = 250.0f;
+ ctx->textRect.y = 250.0f;
ctx->textRect.w = DEFAULT_WINDOW_WIDTH - 2 * ctx->textRect.x;
ctx->textRect.h = 50.0f;
ctx->markedRect = ctx->textRect;
@@ -1062,7 +1062,7 @@ int main(int argc, char *argv[])
SDL_StopTextInput(ctx->window);
} else {
SDL_Log("Enabling text input\n");
- SDL_StartTextInput(ctx->window);
+ SDL_StartTextInputWithProperties(ctx->window, ctx->text_settings);
}
}
break;
@@ -1109,12 +1109,14 @@ int main(int argc, char *argv[])
int index = (event.key.key - SDLK_KP_1);
if (index < state->num_windows) {
SDL_Window *window = state->windows[index];
+ ctx = &windowstate[index];
if (SDL_TextInputActive(window)) {
SDL_Log("Disabling text input for window %d\n", 1 + index);
SDL_StopTextInput(window);
} else {
SDL_Log("Enabling text input for window %d\n", 1 + index);
SDL_StartTextInput(window);
+ SDL_StartTextInputWithProperties(window, ctx->text_settings);
}
}
}