Skip to content

Commit

Permalink
If SetCurrentFocusWidget() is called on a widget which already has fo…
Browse files Browse the repository at this point in the history
…cus then just return. This avoids a lot of unnecessary updates and redraws.
  • Loading branch information
stuartm committed Jun 2, 2012
1 parent e763a6a commit 7a2fc43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mythtv/libs/libmythui/mythscreentype.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ MythUIType *MythScreenType::GetFocusWidget(void) const
} }


bool MythScreenType::SetFocusWidget(MythUIType *widget) bool MythScreenType::SetFocusWidget(MythUIType *widget)
{ {
if (!widget || !widget->IsVisible()) if (!widget || !widget->IsVisible())
{ {
QMap<int, MythUIType *>::iterator it = m_FocusWidgetList.begin(); QMap<int, MythUIType *>::iterator it = m_FocusWidgetList.begin();
Expand All @@ -122,6 +122,9 @@ bool MythScreenType::SetFocusWidget(MythUIType *widget)
if (!widget) if (!widget)
return false; return false;


if (m_CurrentFocusWidget == widget)
return true;

MythUIText *helpText = dynamic_cast<MythUIText *>(GetChild("helptext")); MythUIText *helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
if (helpText) if (helpText)
helpText->Reset(); helpText->Reset();
Expand Down

0 comments on commit 7a2fc43

Please sign in to comment.