History

Only change the menu visibility on the main thread

Ada committed 1 year ago

Commit 656b1d41 parent f5ea94e1 file · +5 −0Browse files

Showing the changes to interface/src/scripting/MenuScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/MenuScriptingInterface.cpp+5−0
@@ -220,6 +220,11 @@ void MenuScriptingInterface::triggerOption(const QString& menuOption) { · 219 unmodified lines
220}220}
221 221
222void MenuScriptingInterface::setVisible(bool visible) {222void MenuScriptingInterface::setVisible(bool visible) {
223 if (QThread::currentThread() != qApp->thread()) {
224 QMetaObject::invokeMethod(this, "setVisible", Q_ARG(bool, visible));
225 return;
226 }
227
223 auto* menuBar = qApp->getWindow()->menuBar();228 auto* menuBar = qApp->getWindow()->menuBar();
224 bool wasVisible = menuBar->isVisible();229 bool wasVisible = menuBar->isVisible();
225 230