Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /guilib/GUIListContainer.cpp [fd4c19] .. [85d082] Maximize Restore

Repo status: analyzing...

  Switch to side-by-side view

--- a/guilib/GUIListContainer.cpp
+++ b/guilib/GUIListContainer.cpp
@@ -126,7 +126,10 @@
     else if (message.GetMessage() == GUI_MSG_SETFOCUS)
     {
       if (message.GetParam1()) // subfocus item is specified, so set the offset appropriately
-        m_cursor = (int)message.GetParam1() - 1;
+      {
+        int item = std::min(m_offset + (int)message.GetParam1() - 1, (int)m_items.size() - 1);
+        SelectItem(item);
+      }
     }
   }
   return CGUIBaseContainer::OnMessage(message);