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
This commit is contained in:
Martin Flöser 2017-09-21 18:27:47 +02:00
parent 5cbd28f9a0
commit 343d8c9b62
2 changed files with 21 additions and 8 deletions

View file

@ -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()

View file

@ -63,6 +63,7 @@ private:
void continueStartupWithScreens();
void continueStartupWithX();
void startXwaylandServer();
void startSession();
bool m_startXWayland = false;
int m_xcbConnectionFd = -1;