Is there any workaround to customize `WindowInsets...
# compose-desktop
s
Is there any workaround to customize `WindowInsets`' values on desktop? They seem to be hardcoded within Compose desktop, and are unfortunately not controllable through a composition local. Tried some stuff with reflection but failed (and since Compose hard-codes the values, it also doesn't expect them to change, so I have to set it up very early) I have 2 use-cases for this: 1. Testing insets without needing to resort to running the mobile version and spinning up the emulator etc... 2. My window is undecorated, and I have a custom window shell around the app's contents, and I'd love to be able to make my custom title bar act like a status bar (and allow drawing underneath it etc...) without having to change the logic of the common code, and insets are the best way this could be handled.
s
The better way is add WindowsInsets.Companion.desktopTitleBar and set it as the getter of the LocalDesktopTitleBarInsets.current
s
That unfortunately doesn't really solve my use-case of testing insets, as that'll be desktop specific and won't be used by any of the window insets modifiers (this is a multiplatform app).
I guess the only way to go now is filing a feature request for this on YouTrack, so that they may hopefully make WindowInsets a CompositionLocal as it should've been
a
Better to file it for Jetpack Compose, as it comes to us from there if I’m not mistaken.
(double-check that, I’m not at the computer right now)
s
Ah alright 👍🏻 Filing on YT always feels better for some reason (the response time is faster? and we can see all status changes to it), but I'll file this one on Google's issue tracker first.