Merge pull request #6859 from spycrab/qt_restore_size

Qt/D3D: Fix render widget size not being restored properly
This commit is contained in:
spycrab 2018-05-18 09:39:12 +02:00 committed by GitHub
commit cfe7f0f5df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -667,6 +667,10 @@ void MainWindow::FullScreen()
// settings. If it's set to be fullscreen then it just remakes the window, // settings. If it's set to be fullscreen then it just remakes the window,
// which probably isn't ideal. // which probably isn't ideal.
bool was_fullscreen = m_render_widget->isFullScreen(); bool was_fullscreen = m_render_widget->isFullScreen();
if (!was_fullscreen)
m_render_widget_geometry = m_render_widget->saveGeometry();
HideRenderWidget(false); HideRenderWidget(false);
SetFullScreenResolution(!was_fullscreen); SetFullScreenResolution(!was_fullscreen);
@ -676,7 +680,6 @@ void MainWindow::FullScreen()
} }
else else
{ {
m_render_widget_geometry = m_render_widget->saveGeometry();
m_render_widget->showFullScreen(); m_render_widget->showFullScreen();
} }
} }
@ -761,6 +764,9 @@ void MainWindow::ShowRenderWidget()
return; return;
} }
SetFullScreenResolution(false);
Host::GetInstance()->SetRenderFullscreen(false);
if (SConfig::GetInstance().bRenderToMain) if (SConfig::GetInstance().bRenderToMain)
{ {
// If we're rendering to main, add it to the stack and update our title when necessary. // If we're rendering to main, add it to the stack and update our title when necessary.
@ -781,8 +787,6 @@ void MainWindow::ShowRenderWidget()
m_render_widget->showNormal(); m_render_widget->showNormal();
m_render_widget->restoreGeometry(m_render_widget_geometry); m_render_widget->restoreGeometry(m_render_widget_geometry);
} }
SetFullScreenResolution(false);
} }
void MainWindow::HideRenderWidget(bool reinit) void MainWindow::HideRenderWidget(bool reinit)