mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix GBAKeyEditor focus issues
This commit is contained in:
parent
05c3159916
commit
6bc609b1e0
|
@ -171,9 +171,10 @@ void GBAKeyEditor::closeEvent(QCloseEvent*) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GBAKeyEditor::event(QEvent* event) {
|
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);
|
m_controller->stealFocus(this);
|
||||||
} else if (event->type() == QEvent::WindowDeactivate) {
|
} else if (type == QEvent::WindowDeactivate || type == QEvent::Hide) {
|
||||||
m_controller->releaseFocus(this);
|
m_controller->releaseFocus(this);
|
||||||
}
|
}
|
||||||
return QWidget::event(event);
|
return QWidget::event(event);
|
||||||
|
|
Loading…
Reference in New Issue