Is there a way to make a desktop component act as pass-through for all mouse event (and not only mouse click) ?
Under windows, I used to override WM_HITTEST with HTTRANSPARENT. I’ve tried to override hitTest in component (returning false), but it doesn’t work (and it’s what setInterceptMouseClicks is supposed to do, right ?)
The idea is that I’m displaying a OSD (on-screen display) desktop component, but I still want the application to receive mouse move event even when the mouse cursor is over the OSD.
In fact, I don’t even want mouseExit to be called at all on component underneath when overing the OSD component.
It doesn’t work, at least under windows. The mouse events are still directed to the desktop component.
I’ve read the code, and windowsIgnoreMouseClick set the WS_EX_TRANSPARENT style (from MSDN):
There is nothing about ignoring mouse event.
On the mac, it does:
[window setIgnoresMouseEvents: (windowStyleFlags & windowIgnoresMouseClicks) != 0];
so this might work (but I don’t have a mac to test).
What about adding a new flag to the component peer ? (so under windows it would do:
case WM_HITTEST:
if (windowStyleFlags & windowIgnoresMouseClicks) return HTTRANSPARENT;
)
Ok, it’s not working.
I don’t know why, it seems that the mouseexit message is generated anyway.
I’ve tried to intercept the WM_MOUSELEAVE message and only call doMouseExit() if the peer under the cursor doesn’t have Ghost flag, but it still doesn’t work.