From 1d4b3a90eb9c716f6dfff8109257d8cc3b885f52 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 29 Nov 2014 09:30:35 -0500 Subject: [PATCH] Micro-optimize RenderWidgetHasFocus(). --- Source/Core/DolphinQt/MainWindow.cpp | 10 ---------- Source/Core/DolphinQt/MainWindow.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 4bb13e29e2..bd3b0e103b 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -261,16 +261,6 @@ void DMainWindow::OnCoreStateChanged(Core::EState state) m_game_tracker->setEnabled(is_not_initialized); } -bool DMainWindow::RenderWidgetHasFocus() -{ - if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) - return isActiveWindow(); - else if (m_render_widget != nullptr) - return m_render_widget->isActiveWindow(); - else - return false; -} - // Update all the icons used in DMainWindow with fresh ones from // "Resources". Call this function after changing the icon theme. void DMainWindow::UpdateIcons() diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 7b17c5eaa4..cee7743adb 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -27,7 +27,7 @@ public: ~DMainWindow(); // DRenderWidget - bool RenderWidgetHasFocus(); + bool RenderWidgetHasFocus() const { return m_render_widget->isActiveWindow(); } DRenderWidget* GetRenderWidget() { return m_render_widget.get(); } signals: