Component focus issue on third party application window


#1

Hi Jules,

JUCE_Version : 1.51.

I’m placing juce Component on a third party application window. The child components are not taking the focus on single click. The child components takes the focus only if I click twice. This issue is only on MAC. Previously I was using JUCE 1.50, it was working fine then. What could be the issue?


#2

Can’t think of any relevant changes… Are you embedding it as an NSView?


#3

Yes Jules. I get an NSView from third party application. I just call this method:
_pJuceComponent->addToDesktop(0, (void*)pNSView);

Thanks,
Dheeraj.


#4

Did you make sure you called setWantKeyboardFocus (true) on your component?


#5

Yes I tried calling it on each component(parent and child). But still it takes two clicks.


#6

Very odd. Without being able to debug it, I can’t think of anything obvious to suggest, so I think you’ll need to do some investigation yourself - perhaps put some breakpoints in the NSViewComponentPeer and JuceNSView classes and see what’s actually happening when you click, and see when it gets and loses focus…