QT: Keep the render window invisible until emulation starts

This commit is contained in:
Sean Maas 2015-05-26 22:35:08 -04:00
parent 0ff414f561
commit 80e9064179

View File

@ -316,6 +316,7 @@ void GMainWindow::ToggleWindowMode() {
// Render in the main window... // Render in the main window...
render_window->BackupGeometry(); render_window->BackupGeometry();
ui.horizontalLayout->addWidget(render_window); ui.horizontalLayout->addWidget(render_window);
if (emu_thread != nullptr)
render_window->setVisible(true); render_window->setVisible(true);
render_window->setFocusPolicy(Qt::ClickFocus); render_window->setFocusPolicy(Qt::ClickFocus);
render_window->setFocus(); render_window->setFocus();
@ -324,6 +325,7 @@ void GMainWindow::ToggleWindowMode() {
// Render in a separate window... // Render in a separate window...
ui.horizontalLayout->removeWidget(render_window); ui.horizontalLayout->removeWidget(render_window);
render_window->setParent(nullptr); render_window->setParent(nullptr);
if (emu_thread != nullptr)
render_window->setVisible(true); render_window->setVisible(true);
render_window->RestoreGeometry(); render_window->RestoreGeometry();
render_window->setFocusPolicy(Qt::NoFocus); render_window->setFocusPolicy(Qt::NoFocus);