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

Fix Wayland crash on layout switch.

CCBUGS: 448178
parent b4911b0d
......@@ -214,7 +214,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
......
......@@ -4648,6 +4648,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
......@@ -93,6 +93,8 @@ public:
QAction *addAction(const QString &name, const QString &text, const QObject *receiver, const char *member, const QIcon &icon = QIcon(),
const QKeySequence &shortcut = QKeySequence(), KActionCategory *category = nullptr);
void processRestoreState(const QByteArray &state);
/**
* @brief Adds a new dock widget to this window.
* @param title title of the dock widget
......
Supports Markdown
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