File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ void SessionManager::prepareLogout(bool force)
174174 stopRedshift ();
175175 stopObexService ();
176176 stopDock ();
177+ stopAppSlice ();
177178
178179 // 防止注销时,蓝牙音频设置没有断开连接
179180 disconnectAudioDevices ();
@@ -513,6 +514,7 @@ void SessionManager::prepareShutdown(bool force)
513514{
514515 stopSogouIme ();
515516 stopBAMFDaemon ();
517+ stopAppSlice ();
516518 preparePlayShutdownSound ();
517519 stopPulseAudioService ();
518520
@@ -689,6 +691,22 @@ void SessionManager::stopDock()
689691 VIEW_SERVICE (DDE_DOCK_SERVICE);
690692}
691693
694+ bool SessionManager::killUnitProcesses (const QString &unit, int signal)
695+ {
696+ auto reply = m_systemd1ManagerInter->KillUnit (unit, " all" , signal);
697+ if (reply.isError ()) {
698+ qWarning () << " failed to kill unit:" << unit << " , error:" << reply.error ().name ();
699+ return false ;
700+ }
701+
702+ return true ;
703+ }
704+
705+ void SessionManager::stopAppSlice ()
706+ {
707+ killUnitProcesses (APP_SLICE, SIGKILL);
708+ }
709+
692710void SessionManager::disconnectAudioDevices ()
693711{
694712 auto msg = QDBusInterface (" org.deepin.dde.Bluetooth1"
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ public Q_SLOTS:
9191 void stopBAMFDaemon ();
9292 void stopRedshift ();
9393 void stopDock ();
94+ bool killUnitProcesses (const QString &unit, int signal);
95+ void stopAppSlice ();
9496 void disconnectAudioDevices ();
9597
9698 void preparePlayShutdownSound ();
Original file line number Diff line number Diff line change 1- // SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd.
1+ // SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd.
22//
33// SPDX-License-Identifier: GPL-3.0-or-later
44
1616#define BAMFDAEMON_SERVICE " bamfdaemon.service"
1717#define REDSHIFT_SERVICE " redshift.service"
1818#define DDE_DOCK_SERVICE " dde-dock.service"
19+ #define APP_SLICE " app.slice"
1920
2021// sound
2122#define SOUND_EFFECT_SCHEMA " com.deepin.dde.sound-effect"
You can’t perform that action at this time.
0 commit comments