Hi, I want to get the window position relative to ...
# compose-desktop
m
Hi, I want to get the window position relative to the screen but the position in windowState includes some extra spacing for padding and top bar, when I compare to the size of the root composable it's a little bit bigger, and when I try to get the root composable position relative to the window I get Offset(0f, 0f), which is not correct. It should include that extra size that the window has comparing to the root composable. Compose version: 1.4.3 Os: Windows Still not tested on Mac, I think that there's the same issue there as well. My goal is to get a composable position relative to the screen.
d
Hello! If it is a bug, can you please create a minimal reproducible sample and share it on GitHub?
a
This is just how Swing reports the window size. You can subtract the window insets to get the content size with window.insets
thank you color 2
m
That's exactly what I want, thanks. I didn't know about window.insets.