Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Andreas Mayer

Am 10.09.2011 um 06:21 schrieb Ken Thomases:

> So, it is apparently intentional that setIgnoresMouseEvents:NO will make a 
> transparent window non-transparent to mouse events. I recognize that this 
> seems to be a change in Lion vs. Snow Leopard, but the Lion behavior seems to 
> restore intended behavior.  I guess you'll know for sure when Apple responds 
> to your bug report.

I don't think that is the way to interpret that paragraph. As far as I 
remember, setIgnoresMouseEvents:YES didn't work prior to 10.3 or 10.4; you had 
to use Carbon calls for this. I know since I just removed the old code.

And even if it was as you say, what would be the way to get the initial 
behavior back after setIgnoresMouseEvents:YES?

(Currently, as a workaround, I create a completely new window and move the 
content view over. Ugh.)


Andreas___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Ken Thomases
On Sep 9, 2011, at 10:43 PM, Andreas Mayer wrote:

> While doing some additional testing before writing a bug report, I noticed 
> that Apple's "RoundTransparentWindow" sample code did work as expected!
> Turns out that setIgnoresMouseEvents:NO will do the actual breaking.

> Bug ID# 10104405
> 
> Summary:
> Sending setIgnoresMouseEvents:NO to a borderless window makes the transparent 
> parts of the window opaque to mouse events.

Hmm.  I'm not so sure that isn't intended.  From the old AppKit release notes, 
circa 10.3 
:

> We fixed -setIgnoresMouseEvents: so that it works more reliably for opaque 
> windows that want to be transparent to mouse events, and also works for 
> transparent windows that want to receive mouse events. In Jaguar, this API 
> only somewhat worked for ignoring events, and did not work at all for 
> receiving mouse events in transparent windows.

So, it is apparently intentional that setIgnoresMouseEvents:NO will make a 
transparent window non-transparent to mouse events. I recognize that this seems 
to be a change in Lion vs. Snow Leopard, but the Lion behavior seems to restore 
intended behavior.  I guess you'll know for sure when Apple responds to your 
bug report.

Regards,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Andreas Mayer

Follow-Up:

While doing some additional testing before writing a bug report, I noticed that 
Apple's "RoundTransparentWindow" sample code did work as expected!
Turns out that setIgnoresMouseEvents:NO will do the actual breaking.

Thus:


Bug ID# 10104405

Summary:
Sending setIgnoresMouseEvents:NO to a borderless window makes the transparent 
parts of the window opaque to mouse events.

Steps to Reproduce:
1. Take RoundTransparentWindow sample project 
(https://developer.apple.com/library/mac/samplecode/RoundTransparentWindow/)

2. Add
[self setIgnoresMouseEvents:NO];
to the CustomWindow class' initializer:

- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)aStyle
  backing:(NSBackingStoreType)bufferingType
defer:(BOOL)flag {
// Using NSBorderlessWindowMask results in a window without a title bar.
self = [super initWithContentRect:contentRect 
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
if (self != nil) {
// Start with no transparency for all drawing into the window
[self setAlphaValue:1.0];
// Turn off opacity so that the parts of the window that are not drawn 
into are transparent.
[self setOpaque:NO];

// this following call will make the transparent parts of the window 
opaque to mouse events!
[self setIgnoresMouseEvents:NO];

}
return self;
}

3. Run project.
4. Click and drag inside the window's frame but outside the visible content. 
The window will move.

Expected Results:
Mouse events should be ignored for transparent parts of the window.

Actual Results:
Window receives mouse events everywhere inside its frame, regardless of opacity.

Regression:
This did work as expected in versions of Mac OS X prior to 10.7.

Notes:
Regarding this specific example: Since the window was initially (per default) 
set up to NOT ignore mouse events anyway, setIgnoresMouseEvents:NO shouldn't do 
anything at all.



Andreas___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Bill Cheeseman

On Sep 9, 2011, at 11:02 AM, Andreas Mayer wrote:

> Make Applidude active and click in one of the corners, outside the gray area. 
> You are still able to move the window.
> 
> That's the bug we are talking about. The click should fall through in 
> transparent areas of the window.


I see what you mean. (I succumbed to the perils of coming in on a thread late. 
Sorry.)

-- 

Bill Cheeseman - b...@cheeseman.name

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Andreas Mayer

Am 09.09.2011 um 11:52 schrieb Bill Cheeseman:

> My clickthrough application still works on 10.7.1. 

Making a window completely ignore mouse clicks still works. But try this:

Make Applidude active and click in one of the corners, outside the gray area. 
You are still able to move the window.

That's the bug we are talking about. The click should fall through in 
transparent areas of the window.


I guess I'll file a bug even though it seems to be a known problem.


Andreas___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-09 Thread Bill Cheeseman

On Sep 9, 2011, at 12:41 AM, Andreas Mayer wrote:

> Am 05.08.2011 um 22:01 schrieb R R Hornback:
> 
> I just found this message while searching for a solution to the same problem.
> 
>> With OS X Lion, even when the window background is transparent, the window 
>> still receives the mouse events.
>> 
>> I have determined that this is related to whether or not the Window is 
>> resizable.  If the window is resizable, the mouse events are handled by the 
>> Window.  If it is NOT resizable, the events in the transparent areas are NOT 
>> handled by the window.
> 
> 
> Are you sure? For me the window always receives the mouse event, even if I 
> use NSBorderlessWindowMask and nothing else. This is on 10.7.1.
> 
> Have you already filed a bug?


My clickthrough application still works on 10.7.1. It is not resizable, though, 
so I can't address the question whether clickthrough fails on resizable 
windows. If you want to try it, download Applidude from 
 and turn off its "Auto motivate" preference.

-- 

Bill Cheeseman - b...@cheeseman.name

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-09-08 Thread Andreas Mayer

Am 05.08.2011 um 22:01 schrieb R R Hornback:

I just found this message while searching for a solution to the same problem.

> With OS X Lion, even when the window background is transparent, the window 
> still receives the mouse events.
> 
> I have determined that this is related to whether or not the Window is 
> resizable.  If the window is resizable, the mouse events are handled by the 
> Window.  If it is NOT resizable, the events in the transparent areas are NOT 
> handled by the window.


Are you sure? For me the window always receives the mouse event, even if I use 
NSBorderlessWindowMask and nothing else. This is on 10.7.1.

Have you already filed a bug?


Andreas


P.S.:  Since the original message is several weeks old, I'll quote it in full 
for reference:

> The desire is to have a bordered, movable, resizable window with a "hollow" 
> interior--hollow meaning that the user can both see through the content area 
> (transparent) and any mouse/keyboard events are sent to whatever 
> window/application is below.
> 
> This was easily accomplished prior to OS X 10.7 Lion by simply having an 
> NSWindow/NSPanel with a transparent background.
> 
> With OS X Lion, even when the window background is transparent, the window 
> still receives the mouse events.
> 
> I have determined that this is related to whether or not the Window is 
> resizable.  If the window is resizable, the mouse events are handled by the 
> Window.  If it is NOT resizable, the events in the transparent areas are NOT 
> handled by the window.
> 
>   NSRect windowRect = NSMakeRect( 200, 200, 200, 200 );
> 
>NSPanel hollowWindowResizable = [[NSPanel alloc] 
> initWithContentRect:windowRect styleMask:(NSHUDWindowMask | 
> NSNonactivatingPanelMask | NSTitledWindowMask | NSResizableWindowMask | 
> NSUtilityWindowMask | NSClosableWindowMask) backing:NSBackingStoreBuffered 
> defer:NO]; 
> 
>[hollowWindowResizable setBackgroundColor:[NSColor clearColor]];
>[hollowWindowResizable setReleasedWhenClosed:YES];
>[hollowWindowResizable setTitle:@"Resizable"];
>[hollowWindowResizable setFloatingPanel:YES];
>[hollowWindowResizable setCanHide:NO];
>[hollowWindowResizable setOpaque:YES];
>[hollowWindowResizable setHasShadow:NO];
> 
>//[hollowWindowResizable setIgnoresMouseEvents:TRUE]; 
>[hollowWindowResizable makeKeyAndOrderFront:nil];
> 
> 
> My guess is that this is a bug introduced with Lion's ability to resize a 
> window from any edge.
> 
> Anyone have any ideas?
> 
> Thanks,

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Lion breaks the ability to "click-through" transparent window areas when the window is resizable.

2011-08-05 Thread R R Hornback
The desire is to have a bordered, movable, resizable window with a "hollow" 
interior--hollow meaning that the user can both see through the content area 
(transparent) and any mouse/keyboard events are sent to whatever 
window/application is below.

This was easily accomplished prior to OS X 10.7 Lion by simply having an 
NSWindow/NSPanel with a transparent background.

With OS X Lion, even when the window background is transparent, the window 
still receives the mouse events.

I have determined that this is related to whether or not the Window is 
resizable.  If the window is resizable, the mouse events are handled by the 
Window.  If it is NOT resizable, the events in the transparent areas are NOT 
handled by the window.

   NSRect windowRect = NSMakeRect( 200, 200, 200, 200 );

NSPanel hollowWindowResizable = [[NSPanel alloc] 
initWithContentRect:windowRect styleMask:(NSHUDWindowMask | 
NSNonactivatingPanelMask | NSTitledWindowMask | NSResizableWindowMask | 
NSUtilityWindowMask | NSClosableWindowMask) backing:NSBackingStoreBuffered 
defer:NO]; 

[hollowWindowResizable setBackgroundColor:[NSColor clearColor]];
[hollowWindowResizable setReleasedWhenClosed:YES];
[hollowWindowResizable setTitle:@"Resizable"];
[hollowWindowResizable setFloatingPanel:YES];
[hollowWindowResizable setCanHide:NO];
[hollowWindowResizable setOpaque:YES];
[hollowWindowResizable setHasShadow:NO];

//[hollowWindowResizable setIgnoresMouseEvents:TRUE]; 
[hollowWindowResizable makeKeyAndOrderFront:nil];


My guess is that this is a bug introduced with Lion's ability to resize a 
window from any edge.

Anyone have any ideas?

Thanks,


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com