From 6bc609b1e02610abb0a100d73c223fecb74a8611 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 17 Jan 2016 16:29:05 -0800 Subject: [PATCH] Qt: Fix GBAKeyEditor focus issues --- src/platform/qt/GBAKeyEditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index 00745d321..cbb74fe85 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -171,9 +171,10 @@ void GBAKeyEditor::closeEvent(QCloseEvent*) { } bool GBAKeyEditor::event(QEvent* event) { - if (event->type() == QEvent::WindowActivate) { + QEvent::Type type = event->type(); + if (type == QEvent::WindowActivate || type == QEvent::Show) { m_controller->stealFocus(this); - } else if (event->type() == QEvent::WindowDeactivate) { + } else if (type == QEvent::WindowDeactivate || type == QEvent::Hide) { m_controller->releaseFocus(this); } return QWidget::event(event);