Fix crash on OS-switch of dark/light mode (#12786)

At least for Mac and Linux. Windows needs testing and possibly its
own fix.
This commit is contained in:
Juergen Spitzmueller 2023-06-10 08:30:31 +02:00
parent eb35e26016
commit 3af906e9f3

View File

@ -1746,7 +1746,9 @@ bool GuiView::event(QEvent * e)
}
case QEvent::ApplicationPaletteChange: {
// runtime switch from/to dark mode
// runtime switch from/to dark mode (Mac OS)
// We need to update metrics here to avoid a crash (#12786)
theBufferList().changed(true);
refillToolbars();
return QMainWindow::event(e);
}
@ -1772,6 +1774,13 @@ bool GuiView::event(QEvent * e)
return QMainWindow::event(e);
}
case QEvent::StyleChange: {
// This might be a change from dark to light mode (Linux)
// We need to update metrics here to avoid a crash (#12786)
theBufferList().changed(true);
return QMainWindow::event(e);
}
default:
return QMainWindow::event(e);
}