Commit 343d8c9b authored by Martin Flöser's avatar Martin Flöser

Support starting kwin_wayland without XWayland support

Summary:
Just continues with the steps without starting XWayland.

This does not yet fully support kwin_wayland without X11, it currently
still crashes on teardown.

Test Plan: kwin_wayland --socket=wayland-1 kwrite (note the missing --xwayland)

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7924
parent 5cbd28f9
......@@ -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()
......
......@@ -63,6 +63,7 @@ private:
void continueStartupWithScreens();
void continueStartupWithX();
void startXwaylandServer();
void startSession();
bool m_startXWayland = false;
int m_xcbConnectionFd = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment