summaryrefslogtreecommitdiff
path: root/src/client/qwaylandintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r--src/client/qwaylandintegration.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index d4724545..5d21e1c7 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -83,10 +83,6 @@ QWaylandIntegration::QWaylandIntegration()
#endif
{
mDisplay.reset(new QWaylandDisplay(this));
- if (!mDisplay->isInitialized()) {
- mFailed = true;
- return;
- }
QWaylandWindow::fixedToplevelPositions =
!qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS");
@@ -99,6 +95,11 @@ QWaylandIntegration::~QWaylandIntegration()
sInstance = nullptr;
}
+bool QWaylandIntegration::init()
+{
+ return mDisplay->initialize();
+}
+
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
{
return mNativeInterface.data();
@@ -168,7 +169,7 @@ QPlatformNativeInterface *QWaylandIntegration::createPlatformNativeInterface()
// Support platform specific initialization
void QWaylandIntegration::initializePlatform()
{
- mDisplay->initialize();
+ mDisplay->initEventThread();
mNativeInterface.reset(createPlatformNativeInterface());
initializeInputDeviceIntegration();
@@ -184,14 +185,9 @@ void QWaylandIntegration::initializePlatform()
void QWaylandIntegration::initialize()
{
- mDisplay->initEventThread();
-
- // Call this after initializing event thread for QWaylandDisplay::forceRoundTrip()
initializePlatform();
- // But the aboutToBlock() and awake() should be connected after initializePlatform().
- // Otherwise the connected flushRequests() may consumes up all events before processEvents starts to wait,
- // so that processEvents(QEventLoop::WaitForMoreEvents) may be blocked in the forceRoundTrip().
+ // Call this after initializing event thread for QWaylandDisplay::flushRequests()
QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests()));
QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests()));