That's a good question. I think that QGuiApplication assumes it will be creating a window at some stage, so will connect to the display server in advance. If you know for sure you're not going to create a window, QCoreApplication should be used instead.
To test this hypothesis, I tried another platform: X11 itself. I ran your test app without a valid X running (actually I faked it by pointing it to a non-existing X socket): DISPLAY=:1 QT_QPA_PLATFORM=xcb ./test and got a very similar crash: http://pastebin.ubuntu.com/24171497/ So I think this is behaving as expected. If you disagree, please re-open this bug and say why. I'd definitely like to know what your use-case is. -G ** Changed in: qtubuntu (Ubuntu) Status: New => Invalid ** Changed in: qtubuntu (Ubuntu) Assignee: (unassigned) => Gerry Boland (gerboland) -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to qtubuntu in Ubuntu. https://bugs.launchpad.net/bugs/1238838 Title: [qpa] QUbuntuIntegration requests screen info which open mir client connection with shell - even if client does not open window Status in qtubuntu package in Ubuntu: Invalid Bug description: Take this application and compile it: ========================> main.cpp <============================= #include <QtGui/QGuiApplication> int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); return a.exec(); } ============================================================== ========================> test.pro <============================= QT += gui TARGET = test TEMPLATE = app SOURCES += main.cpp ============================================================== On desktop, it simply runs, without opening a window, which is fine. On phone with Mir, it will fail to run as Mir (due to unity-mir) rejects it as a client. Since it does not open a window, why should it connect to Mir at all?? Looking into it: #2 0x4200686e in mir::client::DisplayConfiguration::copy_to_client() const () from /usr/lib/arm-linux-gnueabihf/libmirclient.so.3 #3 0x42008a64 in MirConnection::create_copy_of_display_config() () from /usr/lib/arm-linux-gnueabihf/libmirclient.so.3 #4 0x4200761c in mir_connection_get_display_info () from /usr/lib/arm-linux-gnueabihf/libmirclient.so.3 #5 0x41efb344 in ua_ui_display_new_with_index () from /usr/lib/arm-linux-gnueabihf/libubuntu_application_api_mirclient.so.1 #6 0x41ec01f6 in QUbuntuBaseScreen::QUbuntuBaseScreen (this=0x26f98) at screen.cc:82 #7 0x41ebea0a in QUbuntuScreen::QUbuntuScreen (this=0x26f90, options=0x282e0) at screen.cc:54 #8 0x41ebdf80 in QUbuntuIntegration::QUbuntuIntegration (this=0x2a1e8, input_factory=0x41edb824 <(anonymous namespace)::InputAdaptorFactory::instance()::global_instance>) at integration.cc:75 #9 0x41ebdaaa in QUbuntuMirIntegration::QUbuntuMirIntegration (this=0x2a1e8) at integration.cc:39 #10 0x41ebd536 in QUbuntuMirClientIntegrationPlugin::create (this=<optimized out>, system=..., paramList=...) at main.cc:41 #11 0x400c0ba8 in QGuiApplicationPrivate::createPlatformIntegration() () from /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 #12 0x400c11da in QGuiApplicationPrivate::createEventDispatcher() () from /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 #13 0x4057bc86 in QCoreApplication::init() () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 #14 0x4057bcca in QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 #15 0x400c187a in QGuiApplication::QGuiApplication(int&, char**, int) () from /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 which makes sense as in src/platforms/ubuntu/ubuntucommon/integration.cc in the constructor (called on initialization of the QPA plugin) QUbuntuIntegration::QUbuntuIntegration(QUbuntuInputAdaptorFactory *input_factory) there's this line of code: // Create default screen. screen_ = new QUbuntuScreen(options_); screenAdded(screen_); QUbuntuScreen creates a Mir connection, as only Mir has screen info. So the question is: does QGuiApplication really need Screen information, even if it doesn't open a QWindow? To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/qtubuntu/+bug/1238838/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

