Stylianos Gakis
04/01/2026, 2:31 PMwindowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)) on a KMP project and I am on normal Portrait mode
On Android: there is no padding added horizontally since there is nothing there on portrait mode
On iOS: There is some space added on the sides, despite the fact that there is nothing drawn on the edges which would interfere with the UI
Is there something on iOS which I am potentially missing for such horizontal window insets, or is it a bug in the sense that it tries to draw things outside of the area in which one could click and drag to "go back" for example?Stylianos Gakis
04/02/2026, 7:45 AMModifier
.padding(horizontal = 16.dp)
.windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal))
Which on Android it properly resolves to 0.dp in portrait mode, but for iOS there is some arbitrary space which I can't figure out why yetLukas Anda
04/02/2026, 8:45 AMStylianos Gakis
04/02/2026, 11:06 AMStylianos Gakis
04/02/2026, 2:15 PM.windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal))
I get this horizontal space added.
Using
.windowInsetsPadding(WindowInsets.statusBars.only(WindowInsetsSides.Horizontal))
.windowInsetsPadding(WindowInsets.captionBar.only(WindowInsetsSides.Horizontal))
.windowInsetsPadding(WindowInsets.navigationBars.only(WindowInsetsSides.Horizontal))
I get no horizontal spacing at all.
The docs of systemBars says:
"These insets represent all system bars. Includes statusBars, captionBar as well as navigationBars, but not ime."
Time to go touch some grass or smth, because I feel like I am just being trolled laugh cry face palmLukas Anda
04/02/2026, 2:48 PMStylianos Gakis
04/02/2026, 2:51 PMKevin van Mierlo
04/03/2026, 9:13 AMStylianos Gakis
04/07/2026, 7:34 AMStylianos Gakis
04/07/2026, 11:38 AMStylianos Gakis
04/07/2026, 11:40 AMoverride val systemBars: PlatformInsets get() = PlatformInsets(getLeft = { safeAreaInsets().left }, getRight = { safeAreaInsets().right }, getTop = { safeAreaInsets().top }, getBottom = { safeAreaInsets().bottom })
override val statusBars: PlatformInsets get() = PlatformInsets(getTop = { safeAreaInsets().top })
override val navigationBars: PlatformInsets get() = PlatformInsets(getBottom = { safeAreaInsets().bottom })
override val captionBar: PlatformInsets get() = PlatformInsets.Zero
So basically there are some horizontal insets that are only added on the systemBars but not on the three other insets individually.
But I am still not sure what those horizontal insets are supposed to be doing anyway since on iOS on portrait mode there is nothing visually there horizontally that would require the insets to be thereMichal Janecek
04/08/2026, 5:39 PM1.11.0-beta01 , when tried with 1.10.3 , the issue went away!Stylianos Gakis
04/08/2026, 6:13 PMMichal Janecek
04/08/2026, 6:16 PMStylianos Gakis
04/08/2026, 6:53 PMKevin van Mierlo
04/09/2026, 7:04 AMMichal Janecek
04/16/2026, 8:31 PMStylianos Gakis
04/16/2026, 9:57 PMMichal Janecek
04/20/2026, 1:56 PM@Composable
fun Modifier.consumeBogusIosHorizontalInsets(): Modifier {
if (platform != Platform.IOS) return this
return this.consumeWindowInsets(
WindowInsets.systemBars.only(WindowInsetsSides.Horizontal)
)
}
and applied it to the Root composable. I figured out this should be enough and it just 2 file change. What do you think ? Thank youStylianos Gakis
04/20/2026, 2:02 PMMichal Janecek
04/20/2026, 2:06 PMStylianos Gakis
04/20/2026, 2:09 PMMichal Janecek
04/20/2026, 3:12 PMMichal Janecek
04/21/2026, 7:10 AMMichal Janecek
05/05/2026, 1:03 PMStylianos Gakis
05/05/2026, 1:16 PM