Myths of the 21st century: plugin concurrency?

• Oct 3, 2019 - 12:59

OS: macOS 10.14, Arch.: x86_64, MuseScore version (64-bit): 3.3.0.23833, revision: d3bff12

With my dock plugin active, I used a shortcut to activate another, non-dock, non-dialog plugin. The dock plugin was therewith closed and vanished from the screen. Easy enough to get back, but this is not right; this works against the very purpose of docking plugins.

I thought concurrency of plugins was a major issue and design-constraint on object use; it is apparently not possible!


Comments

I suspect that this may happen because that another plugin calls Qt.quit() to signal about finishing its execution. The interesting part is that this triggers QQmlEngine::quit() signal which makes it impossible to distinguish which plugin has called it, at least if we are not going to make a separate engine for each plugin. So just all plugins get eventually closed. I wasn't aware of that when I initially worked on restoring plugins functionality for MuseScore 3 so just made it the same as it was in MuseScore 2, and later it was somewhat late to change this. On the other side, it may happen that we will actually need to have a separate engine per plugin if we are going to create a mechanism to control access to certain resources for plugins (like network, local filesystem).

So the problem is indeed interesting, but for now a workaround should be just to remove Qt.quit() from any other plugins you run until the issue gets resolved.

There is some light at the end of this tunnel; with my dock plugin up, I invoked the triller plugin (a dialog plugin), and dismissed it with the OS red "close" button on the titlebar; whatever it did, it (a) closed and (b) did not dismiss the docked plugin. Plugins should be doing whatever-that-does instead of QtQuit(). What does that do and is it QML accessible?

In reply to by [DELETED] 1831606

I tried close(), parent.close(), and parent.parent.close() in a button handler without success; all were undefined. The QML documentation says that close() exists on QML dialogs, but lists QtQuickDialogs 1.3 as its source (which is not available to our plugins). Can this be fixed easily (i.e., 1.3 made available)? Can you try that to see if it works?

Do you still have an unanswered question? Please log in first to post your question.