From 0baff968453199c06eb063526c950d04e917fa73 Mon Sep 17 00:00:00 2001 From: skyjake Date: Mon, 1 Jul 2013 14:12:52 +0300 Subject: [PATCH] Fixed|libdeng2|RootWidget: Clear focus before calling focusLost() As the method implies past tense, the root widget should clear the focus before making the notification. --- doomsday/libdeng2/src/widgets/rootwidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doomsday/libdeng2/src/widgets/rootwidget.cpp b/doomsday/libdeng2/src/widgets/rootwidget.cpp index e5121c6e6a..7b14219c2f 100644 --- a/doomsday/libdeng2/src/widgets/rootwidget.cpp +++ b/doomsday/libdeng2/src/widgets/rootwidget.cpp @@ -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(); }