Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/VirtualTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
return vt;
}

void jumpToVt(int vt, bool vt_auto) {
void jumpToVt(int vt, bool vt_auto, bool wait) {

Check warning on line 210 in src/common/VirtualTerminal.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'jumpToVt' is never used.
qDebug() << "Jumping to VT" << vt;

int fd;
Expand Down Expand Up @@ -257,7 +257,7 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion src/common/VirtualTerminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void()> onAcquireDisplay, std::function<void()> onReleaseDisplay);
}
}
Expand Down
10 changes: 4 additions & 6 deletions src/daemon/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace DDM {
DaemonApp::instance()->displayManager()->AddSession(
{},
name,
"ddm",
"dde",
static_cast<uint>(VirtualTerminal::currentVt()));

// connect connected signal
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/SeatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/daemon/UserSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ namespace DDM {
_exit(1);
}
}

VirtualTerminal::jumpToVt(vtNumber, !waylandUserSession);
}

// enter Linux namespaces
Expand Down