Skip to content

Commit

Permalink
Merge pull request #6764 from spycrab/qt_fix_rtm
Browse files Browse the repository at this point in the history
Qt: Fix "Render To Main"
  • Loading branch information
degasus committed May 7, 2018
2 parents a7cc104 + 6f65238 commit 6f0ad84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
Expand Up @@ -212,6 +212,8 @@ void GeneralWidget::SaveSettings()
SConfig::GetInstance().bFullscreen = m_enable_fullscreen->isChecked();
// Autoadjust window size
SConfig::GetInstance().bRenderWindowAutoSize = m_autoadjust_window_size->isChecked();
// Render To Main
SConfig::GetInstance().bRenderToMain = m_render_main_window->isChecked();
}

void GeneralWidget::OnEmulationStateChanged(bool running)
Expand Down
10 changes: 8 additions & 2 deletions Source/Core/DolphinQt2/RenderWidget.cpp
Expand Up @@ -158,8 +158,14 @@ bool RenderWidget::event(QEvent* event)
const QResizeEvent* se = static_cast<QResizeEvent*>(event);
QSize new_size = se->size();

const auto dpr =
QGuiApplication::screens()[QApplication::desktop()->screenNumber(this)]->devicePixelRatio();
auto* desktop = QApplication::desktop();

int screen_nr = desktop->screenNumber(this);

if (screen_nr == -1)
screen_nr = desktop->screenNumber(parentWidget());

const auto dpr = desktop->screen(screen_nr)->devicePixelRatio();

emit SizeChanged(new_size.width() * dpr, new_size.height() * dpr);
break;
Expand Down

0 comments on commit 6f0ad84

Please sign in to comment.