Mouse event issue of juce::Component on third party NSWindow


#1

Hi Jules,

JUCE Version : 1.51
OS : 10.5 & 10.6

I have gone through the post regarding shared window focus issue : http://www.rawmaterialsoftware.com/viewtopic.php?t=&f=&p=24594
But I still have focus issue on juce component if I am adding it to third party NSWindow. I tried to resolve the issue and added following code to
juce_mac_NSViewComponentPeer.mm file

- (void) viewDidMoveToWindow
{

	int	options =	NSTrackingMouseEnteredAndExited |    
				         NSTrackingActiveAlways         |
                     NSTrackingMouseMoved	     |
				         NSTrackingInVisibleRect;		  
	
	
	NSTrackingArea *ta;
	
	
	ta = [[NSTrackingArea alloc] initWithRect:NSZeroRect
									  options:options
										owner:self
									 userInfo:nil];
	[self addTrackingArea:ta];
	[ta release];
	
	if (owner != 0)
       owner->viewMovedToWindow();
}

Then Juce::Component starts receiving mouseOver and MouseMoved events but breaks mouseDrag event when dragged out side juce::Component, e.g if i drag a slider and if mouse cursor goes out of juce::Component, then dragging stops.
Everything works fine in juce standalone application. Even I checked these events with cocoa application everything works fine.

Please help me in solving this issue.

Thanks & Regards,
Dheeraj.


#2

Yes, tracking areas don’t seem to provide a way to keep hold of the mouse events when you move outside - that’s why I avoided using them in the library. I’m afraid you’re on your own with that one!


#3

Can you please give any idea to track this issue where it may be going wrong? I have put logger messages in NSComponentPeer.mm file but there are no callbacks in drag methods.


#4

Sorry, all I know is that I tried using tracking a long time ago, and it couldn’t get it to work.