I'm trying to implement something that enables und...
# compose-desktop
l
I'm trying to implement something that enables undecorated Compose Window to utilize native window features, like snapping, dragging, resizing. I'd already implemented it(in fact mostly copy-pasted) and seems to work, but it implements its hit test by itself. I want it to utilize hit test logic from Compose UI. How can I do that? Note: I cannot sure if it is called on the UI thread, I only know that it is called from the listener passed to SetWIndowLongPtrA(hwnd, GWLP_WNDPROC, this one).
k
What do you mean by utilizing layout nodes?
l
For example, when mouse click event happens, Compose would internally hit test to determine which one is clicked. I want to use that logic to determine which node is clicked.
k
It needs more details on how you're integrating with these native APIs. Are you adding compose nodes and wishing to bind them to behave like native decoration elements (window control buttons maybe)?
l
Yes, I want to make
WindowDraggableArea
better by integrating with native api, and maybe something like
WindowResizableFrame
?
k
I'd start with something simpler like adding swing buttons in there via swing integration, getting that working, and then looking at converting those to composables
l
Sorry for the detail; I tried to integrate https://github.com/kalbetredev/CustomDecoratedJFrame into Compose and succeeded but not satisfied with it. It takes properties like
titleBarHeight
,
controlBoxWidth
,
frameBorderThickness
etc. which is inflexible and may not be inconsistent with Compose layout.