mscore commandline not working without a desktop

• Oct 13, 2014 - 11:23

Hi,

I assume not many people will ever try this, but I have found that using mscore on the commandline (I am running Linux Fedora 20) only works after a graphical desktop environment has been launched.
I once in while boot Linux without a desktop.

Why is a graphical desktop needed even if I use mscore as commandline-only tool ?
Bug?

--

MT


Comments

In reply to by Jojo-Schmitz

Good opportunity to demonstrate the bug PLUS answering your question

Before starting X:

# mscore --version
mscore: cannot connect to X server

# startx

After starting X, and opening a Terminal window:

# mscore --version
MuseScore: Music Score Editor; Version 1.3; Build 5702

I can also demonstrate this bug when I open a virtual console. From my Fedora/LXDE desktop I can use ALT+CTRL+F2 (or F3, F4, etc.). Login, and the same bug can be demonstrated.

In the main() function, MuseScore application is created as a QtSingleApplication, which derives from QApplication, which calls GUI libraries and therefore needs a graphical environment.
The corresponding console-only application in Qt is QCoreApplication.
From the comments inside MuseScore\thirdparty\singleapp\src\qtsingleapplication.cpp :
"Creates a QtSingleApplication object. The application identifier
will be QCoreApplication::applicationFilePath(). \a argc, \a
argv, and \a GUIenabled are passed on to the QAppliation constructor.
If you are creating a console application (i.e. setting \a
GUIenabled to false), you may consider using
QtSingleCoreApplication instead.
"
Therefore if we want a pure console-only application when launching from the command line we should use initialize qApp as a QtSingleCoreApplication (and we should check that we are actually not calling any GUI function).

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