Skip to content

Inner size and position should not correspond to the "safe area" size on iOS #1122

@ghost

Description

On iOS the top-left corner of the safe area is inside the client area. With the current API, if you want to accommodate for the safe area on iOS, you call inner_position and inner_size on the window and layout your content accordingly (i.e. move it away from the edges and size it down). However, on the desktop, the top-left corner the client area is not inside the window decorations. Therefore, doing this offset is incorrect on desktop platforms. Let's say that the safe area is 50 pixels wide on iOS and the window decorations are 20 pixels wide on a desktop platform. Your content displays correctly on iOS, but is now off by 20 pixels on the desktop platform. You would need to use conditional compilation to only offset your content on iOS, but this does not seem right to me. It's the same API, but it behaves differently on a different platform. We should instead expose a platform-specific function for querying the safe area size, instead of using inner_position and inner_size for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions