From 8e55374662eb7d5b89b732bd329e744d6894a8c3 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Thu, 13 Jul 2017 12:56:33 -0700 Subject: [PATCH] RenderWidget: watch for activation/deactivation, not focus in/out "Focus" refers mainly to keyboard focus. "Window focus" is exposed through the window activation and deactivation events. --- Source/Core/DolphinQt2/RenderWidget.cpp | 9 +++++---- Source/Core/DolphinQt2/RenderWidget.h | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinQt2/RenderWidget.cpp b/Source/Core/DolphinQt2/RenderWidget.cpp index 3022e00ec2..d01d4dd17b 100644 --- a/Source/Core/DolphinQt2/RenderWidget.cpp +++ b/Source/Core/DolphinQt2/RenderWidget.cpp @@ -14,7 +14,6 @@ RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent) setAttribute(Qt::WA_NoSystemBackground, true); connect(Host::GetInstance(), &Host::RequestTitle, this, &RenderWidget::setWindowTitle); - connect(this, &RenderWidget::FocusChanged, Host::GetInstance(), &Host::SetRenderFocus); connect(this, &RenderWidget::StateChanged, Host::GetInstance(), &Host::SetRenderFullscreen); connect(this, &RenderWidget::HandleChanged, Host::GetInstance(), &Host::SetRenderHandle); emit HandleChanged((void*)winId()); @@ -43,9 +42,11 @@ bool RenderWidget::event(QEvent* event) case QEvent::WinIdChange: emit HandleChanged((void*)winId()); break; - case QEvent::FocusIn: - case QEvent::FocusOut: - emit FocusChanged(hasFocus()); + case QEvent::WindowActivate: + Host::GetInstance()->SetRenderFocus(true); + break; + case QEvent::WindowDeactivate: + Host::GetInstance()->SetRenderFocus(false); break; case QEvent::WindowStateChange: emit StateChanged(isFullScreen()); diff --git a/Source/Core/DolphinQt2/RenderWidget.h b/Source/Core/DolphinQt2/RenderWidget.h index 641bd0b82a..4c7eb6b792 100644 --- a/Source/Core/DolphinQt2/RenderWidget.h +++ b/Source/Core/DolphinQt2/RenderWidget.h @@ -20,7 +20,6 @@ signals: void EscapePressed(); void Closed(); void HandleChanged(void* handle); - void FocusChanged(bool focus); void StateChanged(bool fullscreen); private: