ThreadWithProgressWindow and keyboard focus


#1

Hi Jules,

 

I'm using a ThreadWithProgressWindow in my application.

This one grabs the keyboard focus by default by using enterModalState without any argument.

In standalone, the focus is given back to the main window when the ThreadWithProgressWindow is closed but in plugin, the focus it not given back (happen on both OSX and Windows)

 

Any idea what it could be related to ? 

 

Thanks !


#2

FWIW, changing enterModalState to use false regarding keyboard grabing do not fixes the issue.

 


#3

I have not seen this problem. I use a ThreadWIthProgessWindow with keyboard events but my main plugin window has jucePluginRequiresKeyboardFocus = false. 

As you have probably experienced, these things can be different for each host. What hosts are you having this problem with?

 

 


#4

The problem is not that ThreadWIthProgessWindow do not receive keyboard, it's just that it doesn't give it back to the main window after it is done.

 

I just tried with Live 9 64bits where it never works and in VSTHost sometimes it works sometimes it doesn't.

 

Strange.


#5

Following this, could there be an addition to allow AlertWindow and ThreadWithProgressWindow to not be on the Desktop ?

This would avoid the issue.

 

Thanks !


#6

Good request, though I'm sure that you could already do that, at least with AlertWindow, if you manually added it to a parent - it's only a Component after all.


#7

Well in the ctor of AlertWindow, it create a TopLevelWindow and always gives true to the second "add to desktop" parameter

so you would need to add this flag to AlertWindow ctor


#8

Ok, fair point.