summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/focushandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp
index 306e279ec..5a84b3dd3 100644
--- a/src/gui/focushandler.cpp
+++ b/src/gui/focushandler.cpp
@@ -381,14 +381,14 @@ void FocusHandler::requestFocus(const Widget *const widget)
{
mFocusedWidget = mWidgets.at(toBeFocusedIndex);
+ Event focusEvent(mFocusedWidget);
+ distributeFocusGainedEvent(focusEvent);
+
if (oldFocused != nullptr)
{
- Event focusEvent(oldFocused);
- distributeFocusLostEvent(focusEvent);
+ Event oldFocusEvent(oldFocused);
+ distributeFocusLostEvent(oldFocusEvent);
}
-
- Event focusEvent(mWidgets.at(toBeFocusedIndex));
- distributeFocusGainedEvent(focusEvent);
}
}