Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

try lookup first in CGUIControlGroup::GetFocusedControl()

  • Loading branch information...
commit 83ff7581c49c3f1575c09a98c040a62017f7ad9b 1 parent 274cb40
@pieh pieh authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 xbmc/guilib/GUIControlGroup.cpp
View
13 xbmc/guilib/GUIControlGroup.cpp
@@ -464,6 +464,19 @@ int CGUIControlGroup::GetFocusedControlID() const
CGUIControl *CGUIControlGroup::GetFocusedControl() const
{
+ // try lookup first
+ if (m_focusedControl)
+ {
+ // we may have multiple controls with same id - we pick first that has focus
+ pair<LookupMap::const_iterator, LookupMap::const_iterator> range = m_lookup.equal_range(m_focusedControl);
+ for (LookupMap::const_iterator i = range.first; i != range.second; ++i)
+ {
+ if (i->second->HasFocus())
+ return i->second;
+ }
+ }
+
+ // if lookup didn't find focused control, iterate m_children to find it
for (ciControls it = m_children.begin(); it != m_children.end(); ++it)
{
const CGUIControl* control = *it;
Please sign in to comment.
Something went wrong with that request. Please try again.