Comments (4)
HWND
is handle for any native view on Windows, not "window" handle. Compose provides it as-is from AWT.
Interop blending is just putting Compose above the interop and makes it transparent. So since events are received to top-most view, yes, it's not the same to swing. For interop view compose redispatching events to right view manually via AWT/Swing API.
So the situation is explainable but it's about implementation defaults of not only Compose but also AWT/Swing.
from compose-multiplatform.
Is there a way to get the handle for Compose view?
from compose-multiplatform.
Well Compose has a few views internally. Public windowHandle
is for rendering one (used in skia). Getting handle for other components again is AWT implementation details (with all lightweight/heavyweight specifics), but theoretically it should seem something like https://stackoverflow.com/a/413895/1703290
Another reference: https://github.com/openjdk/jdk/blob/8ffc35d117846a7a2aa08afed662273d2f887770/src/java.desktop/windows/native/libawt/windows/awt_Component.h#L165
But again, please note that it might vary across JDK distributions
from compose-multiplatform.
Currently it's working fine. I'm accepting events from all views of the window but sometimes I'm getting some unwanted events (ex: events for window top bar) which is filtered now using PointerEventType.Enter
and PointerEventType.Exit
to enable/disable the listener. But I want to improve it more by forcing a single HWND
to receive the events from.
I will check the references.
Thank you!
from compose-multiplatform.
Related Issues (20)
- Compose resources fail in Android Studio preview HOT 4
- How can I set shortcuts' name that different with packageName HOT 4
- CupertinoOverscrollEffect keeps LazyColumn offseted up even more items are added in
- TextFiled Cursor Issues HOT 1
- iOS. Crash when exceeding some height value in vertically scrollable content of ModalBottomSheet HOT 1
- Compose Resource incorrectly reads string chunks from a file
- Add androidx.lifecycle.compose.LifecycleEventEffect HOT 2
- Make `SwingPanel` interop blending by default
- Ress Class name - Compose multiplatform resources HOT 1
- Compose layout system doesn't handle `additionalSafeAreaInsets` correctly. HOT 1
- Crash when using `rememberWindowState`: DpSize is unspecified
- Documentation on moving existing Android & IOS production app to KMP state
- [Web][Wasm] Issue with Color Rendering in Compose Web: Inconsistent Lightness in Arabic Fonts HOT 1
- First click inside BasicAlertDialog accompanied by jump of rise component HOT 1
- Dragging to scroll clears selection
- How to use `NavigationSuiteScaffold` ? HOT 1
- Imageviewer build failed (Js Wasm)
- Resources Missing After Publishing Pod to Artifactory HOT 1
- Make livedata available on Apple targets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.