diff --git a/src/common/VirtualTerminal.cpp b/src/common/VirtualTerminal.cpp index 811fdc1..3a95929 100644 --- a/src/common/VirtualTerminal.cpp +++ b/src/common/VirtualTerminal.cpp @@ -207,7 +207,7 @@ namespace DDM { return vt; } - void jumpToVt(int vt, bool vt_auto) { + void jumpToVt(int vt, bool vt_auto, bool wait) { qDebug() << "Jumping to VT" << vt; int fd; @@ -257,7 +257,7 @@ namespace DDM { break; } - if (ioctl(fd, VT_WAITACTIVE, vt) < 0 && errno != EINTR) + if (wait && ioctl(fd, VT_WAITACTIVE, vt) < 0 && errno != EINTR) qWarning("Couldn't finalize jump to VT %d: %s", vt, strerror(errno)); } while (errno == EINTR); diff --git a/src/common/VirtualTerminal.h b/src/common/VirtualTerminal.h index b5251ab..413db40 100644 --- a/src/common/VirtualTerminal.h +++ b/src/common/VirtualTerminal.h @@ -29,7 +29,7 @@ namespace DDM { bool handleVtSwitches(int fd); int currentVt(); int setUpNewVt(); - void jumpToVt(int vt, bool vt_auto); + void jumpToVt(int vt, bool vt_auto, bool wait = true); void setVtSignalHandler(std::function onAcquireDisplay, std::function onReleaseDisplay); } } diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index d89cc75..162ebb8 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -103,7 +103,7 @@ namespace DDM { DaemonApp::instance()->displayManager()->AddSession( {}, name, - "ddm", + "dde", static_cast(VirtualTerminal::currentVt())); // connect connected signal @@ -130,7 +130,7 @@ namespace DDM { } void Display::activateSession(const QString &user, int xdgSessionId) { - if (xdgSessionId <= 0 && user != QStringLiteral("ddm")) { + if (xdgSessionId <= 0 && user != QStringLiteral("dde")) { qCritical() << "Invalid xdg session id" << xdgSessionId << "for user" << user; return; } @@ -324,6 +324,7 @@ namespace DDM { // Open Logind session int xdgSessionId = auth->openSession(env); if (xdgSessionId <= 0) { + qCritical() << "Failed to open logind session for user" << user; auth->stop(); delete auth; return; @@ -336,10 +337,7 @@ namespace DDM { // Exec the desktop process connect(auth, &Auth::userProcessFinished, this, &Display::userProcessFinished); - // FIXME: Someone is triggering VT RELDISP signal during - // fork(), which will cause dead lock on glibc malloc arena - // lock. We have to disable our own VT signal handling - // temporarily... + VirtualTerminal::jumpToVt(auth->tty, false, false); VirtualTerminal::setVtSignalHandler(nullptr, nullptr); auth->startUserProcess(session.exec(), cookie); daemonApp->treelandConnector()->setSignalHandler(); diff --git a/src/daemon/SeatManager.cpp b/src/daemon/SeatManager.cpp index 867e775..fcd9899 100644 --- a/src/daemon/SeatManager.cpp +++ b/src/daemon/SeatManager.cpp @@ -163,7 +163,7 @@ namespace DDM { for (auto display : std::as_const(displays)) { if (display->name == name) { // switch to greeter - display->activateSession("ddm", 0); + display->activateSession("dde", 0); return; } } diff --git a/src/daemon/UserSession.cpp b/src/daemon/UserSession.cpp index 1d07e6a..d8982b4 100644 --- a/src/daemon/UserSession.cpp +++ b/src/daemon/UserSession.cpp @@ -171,8 +171,6 @@ namespace DDM { _exit(1); } } - - VirtualTerminal::jumpToVt(vtNumber, !waylandUserSession); } // enter Linux namespaces