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