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
commit ea1e6640f0
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
7 changed files with 38 additions and 8 deletions

View file

@ -253,6 +253,17 @@
if (camera_server) {
camera_server->handle_display_rotation_change((int)orientation);
}
DisplayServer *display_server = DisplayServer::get_singleton();
if (display_server) {
int out = 0;
if (UIInterfaceOrientationIsPortrait(orientation)) {
out = 1;
} else if (UIInterfaceOrientationIsLandscape(orientation)) {
out = 2;
}
display_server->emit_signal("orientation_changed", out);
}
}];
}
#endif