Skip to content

DisplayServer.screen_get_orientation() returns project settings value instead of runtime orientation when set to SCREEN_SENSOR* #114840

@CatMeowByte

Description

@CatMeowByte

Tested versions

v4.5.stable.official [876b290]

System information

Fedora 43. to test te exported game in Android 12.

Issue description

user likely expect to call the function to get the runtime device orientation so that the logic can branch out accordingly.

turns out calling

DisplayServer.screen_get_orientation()

is equal to

ProjectSettings.get_setting("display/window/handheld/orientation")

someone else mentioned in
#17109

Steps to reproduce

  • start a new android project file with appropriate remote debug
  • set project settings "display/window/handheld/orientation" to SCREEN_SENSOR
  • print(DisplayServer.screen_get_orientation()) anywhere

Minimal reproduction project (MRP)

none provided.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions