mscore commandline not working without a desktop
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
which version of MuseScore?
In reply to which version of MuseScore? 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 reply to Good opportunity to by mtarenskeen
I believe this should be solved with 2.0 Beta 1 or the nightlies. Could you or anyone with a Linux machine check this?
http://musescore.org/en/node/8970 seems to discuss the same question.
Also not working with 2.0 nightly on Ubuntu 14.10.
In reply to http://musescore.org/en/node/ by jschwalm
Those posts are more than 2 years old. Antediluvian ;-)
Test with 2.0 Beta 1 or a newer nightly build.
Edit: oh, you did?
I knowe that the code does check for "noGui" at several places, not sure whether this helps here? Or has been forgotten in some places?
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).