Hey, Any idea why when I use: ```rememberWindowSt...
# compose-desktop
r
Hey, Any idea why when I use:
Copy code
rememberWindowState(size = DpSize(250.dp, 200.dp))
the window is not actually 250dp wide? I mean state says it is, but it doesnt fit 250dp of content (five 50dp-wide boxes should be fully visible):
I also noticed that no matter what is the width, it is always 14dp short.
ok that is because on Windows there are large insets on sides this 14dp is actually equal to
Copy code
window.insets.left+window.insets.right
https://github.com/JetBrains/compose-jb/issues/359
i
You can use Dp.Unspecified instead of 250.dp. Then the window size will be automatically adapted to the content’s width.
r
wow, this is amazing, no more onGloballyPositioned :O
there is one more thing: is there a way to setMinimumSize for a window ? I noticed that if I set size=200 then the size is correct 200 If i set size=1000 and minimumSize=200 then the window is 1000 and can be shrinked only to 200/density minimum so I am setting size=1000 and minimumSize=200*density to get its actual minimum size of 200 BUT If i set size=200 and minimumSize=200*density then the window is always 200*density wide and can be shrinked to only 200 minimum
ok the issue i am talking in the previous comment is java swing bug: https://bugs.openjdk.org/browse/JDK-8221452