[solved] WhichLayer() with transparent windows

This forum is for general developer support questions.
Post Reply
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

[solved] WhichLayer() with transparent windows

Post 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
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [solved] WhichLayer() with transparent windows

Post by zzd10h »

Solution = WA_NoHitThreshold

Solved thanks to m3x.
Many many thanks :D
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
Post Reply