Skip to content

Commit

Permalink
Fixed|libdeng2|RootWidget: Clear focus before calling focusLost()
Browse files Browse the repository at this point in the history
As the method implies past tense, the root widget should clear the
focus before making the notification.
  • Loading branch information
skyjake committed Jul 1, 2013
1 parent 34212e4 commit 0baff96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doomsday/libdeng2/src/widgets/rootwidget.cpp
Expand Up @@ -96,10 +96,11 @@ void RootWidget::setViewSize(Size const &size)

void RootWidget::setFocus(Widget *widget)
{
if(d->focus) d->focus->focusLost();
Widget *oldFocus = d->focus;
d->focus = 0;
if(oldFocus) oldFocus->focusLost();

d->focus = widget;

if(d->focus) d->focus->focusGained();
}

Expand Down

0 comments on commit 0baff96

Please sign in to comment.