Page 1 of 1

[solved] WhichLayer() with transparent windows

Posted: Mon Nov 16, 2015 8:19 am
by zzd10h
Hi,
maybe somebody could help me.

I have a transparent window with a timer that periodically scan what is the
layer where the mouse is with WhichLayer.

If transparency level > 17, the layer is well detected. both on gadget or in
backgound of the window (spacer areas or transparent buttons area).

If transparency <=17 the layer is well detected over the gadgets BUT not
detected on the background of the window
.
In this last case, the detected layer is the one from window behind my window (other window or Workbench
screen)


Is somebody know if it's normal ?

I create my window with

Code: Select all

    SetRast(&alphaRP, TRANSPARENT_LEVEL);     // TRANSPARENT_LEVEL is from 0 (transparent) to 255 (opaque)
and I scan for Layer with

Code: Select all

    LockLayerInfo(&screen->LayerInfo);

    myLayer = WhichLayer(&(screen->LayerInfo),x,y);
    
    UnlockLayerInfo(&screen->LayerInfo);
On the attached picture, Layer is well detected when mouse is over a button but not when mouse is in an area between 2 buttons (only if transparent level is <= 17)

Thank you by advance
Guillaume

Re: [solved] WhichLayer() with transparent windows

Posted: Wed Nov 18, 2015 8:12 pm
by zzd10h
Solution = WA_NoHitThreshold

Solved thanks to m3x.
Many many thanks :D