slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.56k stars 604 forks source link

`Window` that let mouse event go through to other window #6021

Open Enyium opened 2 months ago

Enyium commented 2 months ago

I'm on Windows 10 using Rust.

With a Window with background: transparent; like in the demo project I posted in #6020, the window can, e.g., be dragged at the fully transparent pixels, and hover effects of the window below (like highlighting list items in VS Code or in the browser) won't be triggered.

This is related to #5754, which should be read for some more relevant information. But the other issue is about Slint's own hit testing, whereas this issue is about correctly involving the OS in hit testing in the context of top-level windows.

I only tested this bug with winit and various renderers. I don't know whether it's also present with Qt.

ogoffart commented 2 months ago

This was also mentioned in https://github.com/slint-ui/slint/discussions/5111#discussioncomment-9436493 Workaround for now is to use private API (i-slint-backend-winit) and set_cursor_hittest function of winit.