Skip to content

Commit

Permalink
DolphinQt: Work around surface-already-created error in Wayland when …
Browse files Browse the repository at this point in the history
…stopping
  • Loading branch information
stenzek authored and LaserEyess committed Nov 7, 2022
1 parent 255d63d commit cf18870
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Core/DolphinQt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,11 @@ void MainWindow::HideRenderWidget(bool reinit, bool is_exit)
// Remove the widget from the stack and reparent it to nullptr, so that it can draw
// itself in a new window if it wants. Disconnect the title updates.
m_stack->removeWidget(m_render_widget);
m_render_widget->setParent(nullptr);

// Don't bother unparenting it if we're going to destroy the window anyway.
if (!reinit)
m_render_widget->setParent(nullptr);

m_rendering_to_main = false;
m_stack->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
disconnect(Host::GetInstance(), &Host::RequestTitle, this, &MainWindow::setWindowTitle);
Expand All @@ -1154,9 +1158,7 @@ void MainWindow::HideRenderWidget(bool reinit, bool is_exit)
// recreated
if (reinit)
{
m_render_widget->hide();
disconnect(m_render_widget, &RenderWidget::Closed, this, &MainWindow::ForceStop);

m_render_widget->removeEventFilter(this);
m_render_widget->deleteLater();

Expand Down

0 comments on commit cf18870

Please sign in to comment.