Skip to content

Commit b17866f

Browse files
committed
fix: fix flash black on login
This will work as intended.
1 parent 0340526 commit b17866f

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/common/VirtualTerminal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ namespace DDM {
207207
return vt;
208208
}
209209

210-
void jumpToVt(int vt, bool vt_auto) {
210+
void jumpToVt(int vt, bool vt_auto, bool wait) {
211211
qDebug() << "Jumping to VT" << vt;
212212

213213
int fd;
@@ -257,7 +257,7 @@ namespace DDM {
257257
break;
258258
}
259259

260-
if (ioctl(fd, VT_WAITACTIVE, vt) < 0 && errno != EINTR)
260+
if (wait && ioctl(fd, VT_WAITACTIVE, vt) < 0 && errno != EINTR)
261261
qWarning("Couldn't finalize jump to VT %d: %s", vt, strerror(errno));
262262

263263
} while (errno == EINTR);

src/common/VirtualTerminal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace DDM {
2929
bool handleVtSwitches(int fd);
3030
int currentVt();
3131
int setUpNewVt();
32-
void jumpToVt(int vt, bool vt_auto);
32+
void jumpToVt(int vt, bool vt_auto, bool wait = true);
3333
void setVtSignalHandler(std::function<void()> onAcquireDisplay, std::function<void()> onReleaseDisplay);
3434
}
3535
}

src/daemon/Display.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace DDM {
130130
}
131131

132132
void Display::activateSession(const QString &user, int xdgSessionId) {
133-
if (xdgSessionId <= 0 && user != QStringLiteral("ddm")) {
133+
if (xdgSessionId <= 0 && user != QStringLiteral("dde")) {
134134
qCritical() << "Invalid xdg session id" << xdgSessionId << "for user" << user;
135135
return;
136136
}
@@ -336,13 +336,11 @@ namespace DDM {
336336

337337
// Exec the desktop process
338338
connect(auth, &Auth::userProcessFinished, this, &Display::userProcessFinished);
339-
// FIXME: Someone is triggering VT RELDISP signal during
340-
// fork(), which will cause dead lock on glibc malloc arena
341-
// lock. We have to disable our own VT signal handling
342-
// temporarily...
343-
VirtualTerminal::setVtSignalHandler(nullptr, nullptr);
344-
auth->startUserProcess(session.exec(), cookie);
345-
daemonApp->treelandConnector()->setSignalHandler();
339+
VirtualTerminal::jumpToVt(auth->tty, false, false);
340+
auto exec = session.exec();
341+
QMetaObject::invokeMethod(this, [auth, exec, cookie] {
342+
auth->startUserProcess(exec, cookie);
343+
});
346344

347345
// The user process is ongoing, append to active auths
348346
// The auth will be delete later in userProcessFinished()

0 commit comments

Comments
 (0)