Micro-optimize RenderWidgetHasFocus().

This commit is contained in:
Augustin Cavalier 2014-11-29 09:30:35 -05:00
parent 74291017e5
commit 1d4b3a90eb
2 changed files with 1 additions and 11 deletions

View File

@ -261,16 +261,6 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
m_game_tracker->setEnabled(is_not_initialized); 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 // Update all the icons used in DMainWindow with fresh ones from
// "Resources". Call this function after changing the icon theme. // "Resources". Call this function after changing the icon theme.
void DMainWindow::UpdateIcons() void DMainWindow::UpdateIcons()

View File

@ -27,7 +27,7 @@ public:
~DMainWindow(); ~DMainWindow();
// DRenderWidget // DRenderWidget
bool RenderWidgetHasFocus(); bool RenderWidgetHasFocus() const { return m_render_widget->isActiveWindow(); }
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); } DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
signals: signals: