How to support OS window features (snapping & animations) with a custom title bar on Compose Desktop?

53 views Asked by At

When making an app with custom decorations, I have noticed the following problems on Windows 11:

  1. No snap layout menu on hover over the maximize button
  2. No snap layout on edges and corners of the screen
  3. No window shadows
  4. No animations for minimizing, maximizing, restoring and closing

Some other Apps with custom title bars also don't have the hover menu (e.g. Discord, Photoshop, Surfshark, Chocolatey GUI) but at least they support the edge and corner snapping and the hover menu can still be accessed with WIN + Z.

Is there any way to achieve at least the points 2-4 with Compose for Desktop?

I am using the WindowScope.WindowDraggableArea() for my title bar but making the window draggable is all it does and it does not seem to make Windows aware of the window being dragged.

AFAIK Compose Desktop is based on Swing and IntelliJ IDEA, which is also based on Swing, does support all window features, including the hover menu, so there should technically be a way to do this, right?

The Toolbox app by JetBrains is also built with Jetpack Compose and does have a shadow.

0

There are 0 answers