My KWIN fork where I work on features like per-output virtual desktops
Find a file
Martin Gräßlin 9d5d8d0871 Display can start the server before QCoreApplication is created
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.
2014-11-07 11:41:37 +01:00
src/wayland Display can start the server before QCoreApplication is created 2014-11-07 11:41:37 +01:00