Commit a6b0ac90 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix Wayland crash on layout switch.

CCBUGS: 448178
parent b4221495
Pipeline #133098 passed with stage
in 7 minutes and 3 seconds
......@@ -228,7 +228,7 @@ bool LayoutManagement::loadLayout(const QString &layoutId, bool selectButton)
state.remove(0, 5);
}
pCore->window()->centralWidget()->setHidden(!timelineVisible);
pCore->window()->restoreState(state);
pCore->window()->processRestoreState(state);
pCore->window()->tabifyBins();
if (selectButton) {
// Activate layout button
......
......@@ -4453,6 +4453,14 @@ int MainWindow::binCount() const
return m_binWidgets.count();
}
void MainWindow::processRestoreState(const QByteArray &state)
{
// On Wayland, restoreState crashes when quickly hiding/showing/hiding a monitor in restoreState, so hide before restoring
m_projectMonitorDock->close();
m_clipMonitorDock->close();
restoreState(state);
}
#ifdef DEBUG_MAINW
#undef DEBUG_MAINW
#endif
......@@ -98,6 +98,8 @@ public:
QAction *addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon,
const QKeySequence &shortcut, const QString &category);
void processRestoreState(const QByteArray &state);
/**
* @brief Adds a new dock widget to this window.
* @param title title of the dock widget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment