Skip to content
Browse files

If SetCurrentFocusWidget() is called on a widget which already has fo…

…cus then just return. This avoids a lot of unnecessary updates and redraws.
  • Loading branch information...
1 parent e763a6a commit 7a2fc43843788e0ebeb2275ae8c5149e6ead816b @stuartm stuartm committed Jun 2, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 mythtv/libs/libmythui/mythscreentype.cpp
View
5 mythtv/libs/libmythui/mythscreentype.cpp
@@ -100,7 +100,7 @@ MythUIType *MythScreenType::GetFocusWidget(void) const
}
bool MythScreenType::SetFocusWidget(MythUIType *widget)
-{
+{
if (!widget || !widget->IsVisible())
{
QMap<int, MythUIType *>::iterator it = m_FocusWidgetList.begin();
@@ -122,6 +122,9 @@ bool MythScreenType::SetFocusWidget(MythUIType *widget)
if (!widget)
return false;
+ if (m_CurrentFocusWidget == widget)
+ return true;
+
MythUIText *helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
if (helpText)
helpText->Reset();

0 comments on commit 7a2fc43

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