Cguiwindow::getfocuscontrol() doesnt return id
#1
in my python script i noticed xbmcgui.window.getfocus() was not returning the correct control. i traced this problem to

guilib/guiwindow.cpp
Quote:int cguiwindow::getfocuscontrol()
{
for (int i=0; i < (int)m_veccontrols.size(); ++i)
{
cguicontrol* pcontrol= m_veccontrols[i];
if (pcontrol->hasfocus()) return i;
}
return -1;
}

it is returning the control index
lib/libpython/xbmcmodule/window.cpp - window_getfocus() assumes it is returning the control id. does any other code use this function and is counting on a control index?

i think the line should be changed to
Quote: if (pcontrol->hasfocus()) return pcontrol->getid();

i'd do the fix myself but dont have an environment setup (traced this just by browsing the cvs on sourceforge).
Reply
#2
there is a function called getfocusedcontrol(). this returns the id of the focused control.

greets

bobbin007
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
lol ok... then the bug is just in

xbmc/lib/libpython/xbmcmodule/window.cpp - window_getfocus()

Quote:...
icontrolid = pwindow->getfocuscontrol();
...

should be

Quote:...
icontrolid = pwindow->getfocusedcontrol();
...

can someone make the fix? thanks

-ast
Reply
#4
fixed in cvs forgotten to reply Blush

greets

bobbin007
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Cguiwindow::getfocuscontrol() doesnt return id0