diff --git a/main_wayland.h b/main_wayland.h --- a/main_wayland.h +++ b/main_wayland.h @@ -63,6 +63,7 @@ void continueStartupWithScreens(); void continueStartupWithX(); void startXwaylandServer(); + void startSession(); bool m_startXWayland = false; int m_xcbConnectionFd = -1; diff --git a/main_wayland.cpp b/main_wayland.cpp --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -159,7 +159,14 @@ createScreens(); if (!m_startXWayland) { - continueStartupWithX(); + createCompositor(); + connect(Compositor::self(), &Compositor::sceneCreated, this, + [this] { + startSession(); + createWorkspace(); + notifyKSplash(); + } + ); return; } createCompositor(); @@ -214,6 +221,18 @@ ::exit(1); } + m_environment.insert(QStringLiteral("DISPLAY"), QString::fromUtf8(qgetenv("DISPLAY"))); + + startSession(); + createWorkspace(); + + Xcb::sync(); // Trigger possible errors, there's still a chance to abort + + notifyKSplash(); +} + +void ApplicationWayland::startSession() +{ if (!m_inputMethodServerToStart.isEmpty()) { int socket = dup(waylandServer()->createInputMethodConnection()); if (socket >= 0) { @@ -239,7 +258,6 @@ } } - m_environment.insert(QStringLiteral("DISPLAY"), QString::fromUtf8(qgetenv("DISPLAY"))); // start session if (!m_sessionArgument.isEmpty()) { QProcess *p = new Process(this); @@ -260,12 +278,6 @@ p->start(application); } } - - createWorkspace(); - - Xcb::sync(); // Trigger possible errors, there's still a chance to abort - - notifyKSplash(); } void ApplicationWayland::createX11Connection()