Giter Club home page Giter Club logo

Comments (4)

MatkovIvan avatar MatkovIvan commented on June 20, 2024

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.

MohamedRejeb avatar MohamedRejeb commented on June 20, 2024

Is there a way to get the handle for Compose view?

from compose-multiplatform.

MatkovIvan avatar MatkovIvan commented on June 20, 2024

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.

MohamedRejeb avatar MohamedRejeb commented on June 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.