Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I created a notebook and was manipulating its WindowOpacity option:

nb = CreateDocument[];
Manipulate[SetOptions[nb, WindowOpacity -> op], {{op, .3}, 0, 1}]

It works fine as a half-transparent window when the option has a value not too small, say 0.3 (Have written something in nb to make it more prominent against the web brower window behind):

Mathematica graphics

But when the value of the option is less than a certain threshold (in my case 0.004), the nb window seems to be "click-through" for mouse, eventhough it should be still in place in front of the web brower window:

Mathematica graphics

The question: Is this "click-through" behavior a feature or a bug-like thing? And why such a nonzero threshold?

ps. My environment is Windows 7 (x64) and Mathematica 8.0.4.

share|improve this question
1  
Behavior confirmed in version 7 on Windows 7. –  Mr.Wizard Aug 12 '12 at 10:28
1  
Same in version 8 on XP Pro SP3. –  stevenvh Aug 12 '12 at 10:35
1  
Confirmed on Mac OSX Lion, V 8.0.4. –  JxB Aug 12 '12 at 14:57
1  
Might this actually be a safety feature? If you could activate something by pressing a near invisible button while the user thinks he's pressing another button that would be a kind of an exploit. –  Sjoerd C. de Vries Aug 12 '12 at 20:18
3  
In v8 on Win7-64 the threshold is 1/255. At 1/256 the click-through occurs. I assume window opacity is stored in an 8 bit alpha channel and therefore any opacity less than 1/255 corresponds to perfect transparency. As @SjoerdC.deVries says, one wouldn't expect a transparent window to intercept clicks for security reasons. –  Simon Woods Aug 12 '12 at 21:17

1 Answer 1

up vote 3 down vote accepted

Changing the code to look at the reciprocal of the opacity:

nb = CreateDocument[];
Manipulate[SetOptions[nb, WindowOpacity -> 1/op]; 1/op, {{op, 1}, 1, 300, 1}]

reveals that the threshold opacity is 1/255. (At least this is the case on Windows 7 x64).

At any WindowOpacity less than 1/255 the click-through occurs. It seems likely that the window opacity is stored in an 8 bit alpha channel and therefore any value less than 1/255 corresponds to perfect transparency. Presumably the click-through is the default behaviour for fully transparent windows.

share|improve this answer
    
Sounds very reasonable. Will accept this answer. –  Silvia Aug 14 '12 at 4:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.