Kodi Community Forum

Full Version: SetFocus problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

If I use setFocus in a dialog window, the underlying window seems to lose it's focus too... is this intended or a bug?
It's intended - you can only have focus on one thing at a time.
If I open a dialog I have focus let's say on control 400 and the underlying window has still focus on control 50 if I close the dialog window. But if I have an extra button to run a script in the dialog window and use setFocus there the underlying window loses focus on control 50 (or whichever control had focus). Worst case is that you can't do anything in that window because the control does not exist and no control has focus. I think setFocus should set the focus only in the current active window where the user can interact so this would not happen.
Are you saying that setFocus is being sent to both the dialog AND the underlying window? You can test this pretty easily by putting a control with the same id in both dialog and window.

I'm assuming, ofcourse, that the dialog has focus (i.e. it's a modal dialog).

Cheers,
Jonathan
Yes that's what I'm saying... I do setFocus(50) in the movie information dialog and when I close the dialog, 50 has also focus in myvideonav so I need an extra click to get focus on the right container again. On home I can't do anything if I open & close the guide menu (player controls) because the control id which get's focus in the guide menu doesn't exist on home.
Ok - that's definitely not the desired behaviour. Mind popping up a trac ticket and cc'ing me?

Cheers,
Jonathan
I had this problem - would another solution be to give the actor id, which is 50 in movieinformation, a more unique id like 388 or something?

Because I've wanted to create effects where the poster slides out when movieinformation window visible but that effect causes problems cause it's standard practice that everyones basic "files/list" view had id=50...
I had this problem last year and ended up changing the viewtype with id 50 and all it's instances throughout the skin. Not fun.
jmarshall Wrote:Ok - that's definitely not the desired behaviour. Mind popping up a trac ticket and cc'ing me?

Cheers,
Jonathan

Done Smile