Skip to content
  • Martin Flöser's avatar
    Display can start the server before QCoreApplication is created · 9d5d8d08
    Martin Flöser authored
    Event dispatching in Display requires a QSocketNotifier which
    requires the QCoreApplication to be created. This requirement renders
    it impossible to create the server before the QCoreApplication is
    created. But there are use cases which need this:
    
    Let's assume we want to integrate a wayland server into an existing
    X11 dependent application which uses QApplication and enforces the
    xcb plugin. This means said application requires that an X Server is
    up and running before the QApplication is created. If we want said
    application to connect to an Xwayland server we need to be able to
    create the Wayland server AND the Xwayland server before creating
    the QApplication.
    
    The solution is to only create the socket notifier if the
    QCoreApplication exists. For the case that it doesn't exist an
    additional method is added which needs to be called once the
    QCoreApplication got created. In addition a manual event dispatch
    method is added which allows to block for events when we don't
    have a QSocketNotifier set up yet.
    9d5d8d08