Merge pull request #115434 from syntaxerror247/landscape-or-portrait

Add device orientation change signal to DisplayServer
This commit is contained in:
Thaddeus Crews
2026-01-27 15:18:22 -06:00
7 changed files with 38 additions and 8 deletions

View File

@@ -662,7 +662,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererPaused(JNIE
}
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onScreenRotationChange(JNIEnv *env, jclass clazz, jint p_orientation) {
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onOrientationChange(JNIEnv *env, jclass clazz, jint p_orientation) {
if (step.get() <= STEP_SETUP) {
return;
}
@@ -671,6 +671,11 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onScreenRotationChang
if (camera_server) {
camera_server->handle_display_rotation_change(p_orientation);
}
DisplayServer *display_server = DisplayServer::get_singleton();
if (display_server) {
display_server->emit_signal("orientation_changed", p_orientation);
}
}
JNIEXPORT jboolean JNICALL Java_org_godotengine_godot_GodotLib_shouldDispatchInputToRenderThread(JNIEnv *env, jclass clazz) {