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
2 changes: 0 additions & 2 deletions src/dde-session/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ add_executable(dde-session
impl/iowait/iowaitwatcher.cpp
impl/iowait/xcursor_remap.h
impl/iowait/xcursor_remap.c
../utils/dconf.h
../utils/dconf.cpp
../utils/fifo.h
../utils/fifo.cpp
../utils/utils.h
Expand Down
35 changes: 5 additions & 30 deletions src/dde-session/impl/sessionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "sessionmanager.h"
#include "inhibitor.h"
#include "inhibitor1adaptor.h"
#include "utils/dconf.h"
#include "utils/utils.h"
#include "org_deepin_dde_Audio1_Sink.h"

Expand All @@ -19,11 +18,14 @@
#include <QDBusPendingCall>
#include <QDBusPendingCallWatcher>
#include <QSocketNotifier>
#include <DConfig>

#include <unistd.h>
#include <signal.h>
#include <xcb/xcb.h>

using namespace Dtk::Core;

#define MASK_SERVICE(service) \
{\
auto reply = m_systemd1ManagerInter->MaskUnitFiles(QStringList() << service, true, true);\
Expand Down Expand Up @@ -138,10 +140,6 @@ void SessionManager::initConnections()
}
});

if (Dconf::GetValue("com.deepin.dde.startdde", "", "swap-sched-enabled", QVariant(false)).toBool()) {
initSwapSched();
}

connect(m_DBusInter, &org::freedesktop::DBus::NameOwnerChanged,
[ = ](const QString &name, const QString &oldOwner, const QString &newOwner) {
if (newOwner == "" && oldOwner != "" && name == oldOwner && name.startsWith(":")) {
Expand All @@ -156,12 +154,6 @@ void SessionManager::initConnections()
, "Unlock", this, SLOT(handleLoginSessionUnlocked()));
}

void SessionManager::initSwapSched()
{
qDebug() << "init swap sched";
// TODO
}

void SessionManager::prepareLogout(bool force)
{
if (!force)
Expand Down Expand Up @@ -463,14 +455,6 @@ void SessionManager::RequestSuspend()
return;
}

// 使用窗管接口进行黑屏处理
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", QVariant(false))) {
QDBusInterface inter("org.kde.KWin", "/BlackScreen", "org.kde.kwin.BlackScreen", QDBusConnection::sessionBus(), this);
const QDBusMessage &msg = inter.call("setActive", true);
if (!msg.errorName().isEmpty())
qWarning() << "failed to create blackscreen, error: " << msg.errorName();
}

QDBusPendingReply<> reply = m_login1ManagerInter->Suspend(false);
if (reply.isError()) {
qWarning() << "failed to suspend, error:" << reply.error().name();
Expand Down Expand Up @@ -835,7 +819,8 @@ void SessionManager::playLogoutSound()
void SessionManager::setDPMSMode(bool on)
{
if (Utils::IS_WAYLAND_DISPLAY) {
EXEC_COMMAND("dde_wldpms", QStringList() << "-s" << (on ? "On" : "Off"));
// TODO
// EXEC_COMMAND("dde_wldpms", QStringList() << "-s" << (on ? "On" : "Off"));
} else {
// TODO 可通过Xlib发送对应请求实现此功能
EXEC_COMMAND("xset", QStringList() << "dpms" << "force" << (on ? "on" : "off"));
Expand Down Expand Up @@ -870,11 +855,6 @@ void SessionManager::shutdown(bool force)
qWarning() << "failed to power off, error: " << reply.error().name();
}

//NOTE: do we need it anymore?
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", false)) {
setDPMSMode(false);
}

qApp->quit();
}

Expand All @@ -888,11 +868,6 @@ void SessionManager::reboot(bool force)
qWarning() << "failed to reboot, error: " << reply.error().name();
}

// NOTE: do we need it anymore?
if (Dconf::SetValue("com.deepin.dde.startdde", "", "quick-black-screen", QVariant(false))) {
setDPMSMode(false);
}

qApp->quit();
}

Expand Down
1 change: 0 additions & 1 deletion src/dde-session/impl/sessionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public Q_SLOTS:
~SessionManager();

void initConnections();
void initSwapSched();
void prepareLogout(bool force);
void prepareShutdown(bool force);
void clearCurrentTty();
Expand Down
25 changes: 7 additions & 18 deletions src/dde-session/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -133,18 +133,6 @@ int main(int argc, char *argv[])
OthersManager().init();
});

#if 0 //TODO has no 'com.deepin.dde.startdde' gsetting
// cpu iowait状态检测
if (Utils::SettingValue("com.deepin.dde.startdde", QByteArray(), "iowait-enabled", false).toBool()) {
QtConcurrent::run([] {
auto watcher = new IOWaitWatcher;
watcher->start();
});
} else {
qInfo() << "iowait watcher disabled";
}
#endif
qInfo() << "iowait watcher disabled";

QThreadPool::globalInstance()->start([&session]() {
qInfo()<< "systemd service pipe thread id: " << QThread::currentThreadId();
Expand All @@ -158,14 +146,15 @@ int main(int argc, char *argv[])
int pid = CurSessionPid.toInt(&ok);
qInfo() << "dde-session pid: " << CurSessionPid;
if (ok && pid > 0) {
// TODO session在主线程中创建,在这里直接使用是有问题的
session->setSessionPid(pid); // TODO: session别直接调用
session->setSessionPath();
QMetaObject::invokeMethod(session, [session, pid]() {
session->setSessionPid(pid);
session->setSessionPath();
}, Qt::QueuedConnection);
}
}
fifo->deleteLater();
delete fifo;
qInfo() << "pipe read finish, app exit.";
qApp->quit();
QMetaObject::invokeMethod(qApp, &QCoreApplication::quit, Qt::QueuedConnection);
});
sd_notify(0, "READY=1");

Expand Down
62 changes: 0 additions & 62 deletions src/utils/dconf.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions src/utils/dconf.h

This file was deleted.

Loading