Skip to content
Browse files

guilib: if currently focused control can no longer be focused, fallba…

…ck to default control

fixes #13117
  • Loading branch information...
1 parent 07ae1d6 commit 274cb4000598a4d404c693fa463e91fcd89bca33 @pieh pieh committed Jul 19, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 xbmc/guilib/GUIWindow.cpp
6 xbmc/guilib/GUIWindow.cpp
@@ -302,6 +302,12 @@ void CGUIWindow::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregi
CGUIControlGroup::DoProcess(currentTime, dirtyregions);
if (size != g_graphicsContext.RemoveTransform())
CLog::Log(LOGERROR, "Unbalanced UI transforms (was %d)", size);
+ // check if currently focused control can have it
+ // and fallback to default control if not
+ CGUIControl* focusedControl = GetFocusedControl();
+ if (focusedControl && !focusedControl->CanFocus())
+ SET_CONTROL_FOCUS(m_defaultControl, 0);
void CGUIWindow::DoRender()

6 comments on commit 274cb40

Team Kodi member

What in particular made the bit where we set focus to the default control on receiving an action not work? As if we can fix this more non-intrusively it would take care of #1702

Team Kodi member

By the looks adding the !focusedControl->CanFocus() check to line 411 would be the better fix for this, and might also solve #1702?

Team Kodi member
pieh commented on 274cb40 Nov 1, 2012

Reason for doing it this way was not to wait on user action and just do it automaticly (so no technical reason, just design/user experience one).

This wouldn't really solve issue, just hide it a little, as we still would hit same issue if user would trigger action between list clearing and updating list.

Team Kodi member

@pieh so you're saying we best put this one in all the update methods?

Team Kodi member

was talking about #1702

Team Kodi member

ping @pieh. could you have a look at #1702

Please sign in to comment.
Something went wrong with that request. Please try again.