2004-12-28, 11:23
in my python script i noticed xbmcgui.window.getfocus() was not returning the correct control. i traced this problem to
guilib/guiwindow.cpp
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
i'd do the fix myself but dont have an environment setup (traced this just by browsing the cvs on sourceforge).
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).