Is there any documentation around Compose Desktop'...
# compose-desktop
r
Is there any documentation around Compose Desktop's handling of multiple physical screens? Context: I am aligning windows relative to each other, but it's unclear how this will work in Compose, because
WindowState
only contains coordinates with no "display" that they are relative to.
a
Not that I know off. if i were you I would look at how this can be done using Swing. Use those APIs and then 'translate' that to Compose if needed
👍 1
a
You can get the underlying AWT
window
and use that.
👍 1
r
Window.graphicsConfiguration.device
has the right information, it's just not observable since it's not part of Compose 😞 It also seems like even if you have the
GraphicsDevice
from that, Swing offers no way to move a window between screens, other than
Window.setLocationRelativeTo(Component)
, which isn't really ideal. It'd be great if
WindowState
(or
WindowPosition
) had a
display
field on it
a
You have the same tools as we do in that regard.
e
Wayland doesn't allow clients to place their own windows, so such an approach would be limited on some platforms at least
r
Oh very interesting. Even undecorated windows? How do things like menus/popovers that extend outside the window bounds work in that case?
a
By specifying the parent/owner window, I imagine.
r
Context: I've built fairly robust support for these features for compose on Windows -- essentially NSPopover/Flyout that aren't constrained to the window itself
Ah, definitely looks like I'll need to investigate Wayland at some point. Currently using DialogWindow as the base, which I believe does set the owner properly.
And as a sidenote, life would be way easier if there were more window lifecycle hooks available when instantiating windows. A good example is that ComposeWindow is implicitly final, but Swing requires subclassing and method overrides to customise certain advanced behaviours (e.g. changing paint behaviour)
a
what is wayland?
r
A system for drawing/managing windows used by some Linux distributions.
👍 1