all repos — mgba @ 6bc609b1e02610abb0a100d73c223fecb74a8611

mGBA Game Boy Advance Emulator

Qt: Fix GBAKeyEditor focus issues
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jan 2016 16:29:05 -0800
commit

6bc609b1e02610abb0a100d73c223fecb74a8611

parent

05c3159916950b8b8280348fb2b4c02c40c00ee9

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/platform/qt/GBAKeyEditor.cppsrc/platform/qt/GBAKeyEditor.cpp

@@ -171,9 +171,10 @@ m_controller->releaseFocus(this);

} 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);