Re: Click Through Bug?
Re: Click Through Bug?
- Subject: Re: Click Through Bug?
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 19 Feb 2003 18:39:19 -0800
On Thursday, February 6, 2003, at 09:20 PM, Perry Clarke wrote:
On Wednesday, February 5, 2003, at 18:47, John C. Randolph wrote:
On Wednesday, February 5, 2003, at 03:34 PM, Perry Clarke wrote:
> My theory is that for each mouse click the window manager checks the
> windows under it until it finds the first non-transparent one and
> gives the click to the application that owns that window. If a
> borderless window is in the middle of repainting itself when the
> window manager checks its transparency, the window manager may
> incorrectly decide the window (or, at least, the area under the
mouse)
> is transparent and should not get the click.
The window manager is behaving correctly in this case. Wherever a
window is transparent, clicks will pass through to the next
non-transparent window. In your example, at the time that it's
checked, the window *is* transparent.
The bug is that the opaque contents of the window are replaced with
other opaque contents (e.g. a button changing state) but the window
manager appears to be detecting a moment of transparency during this
process (a process that is atomic in Cocoa, drawAtPoint). If this
behavior isn't a bug then creating non-rectangular windows with custom
controls in them seems impossible (without suffering click-through).
One thing you might try here is to paint the window background with a
color that has a very low alpha value, but keep in mind that the user
will expect events to go the window that he can see under the cursor,
not to a transparent window.
That is the problem with trying to make the window itself opaque. For
a non-rectangular window to work as the user expects they want clicks
on transparent areas of the window to go through as you describe.
Perry,
Have you tried running your app under QuartzDebug to see what exactly
is being drawn, and in what sequence? It may well be that at some
stage, the window getting filled with the clear color before the new
image is composited in place.
You mentioned that you have a test case that you derived from the Round
Transparent Window example. How about sending me that project?
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.