diff --git a/9000-fix-lastLogoutUser-root-bug.patch b/9000-fix-lastLogoutUser-root-bug.patch new file mode 100644 index 0000000..d23eeaf --- /dev/null +++ b/9000-fix-lastLogoutUser-root-bug.patch @@ -0,0 +1,202 @@ +From a8a0810d6966af7c212261444fe04bb3aafc6251 Mon Sep 17 00:00:00 2001 +From: uos +Date: Wed, 5 Jul 2023 17:05:31 +0800 +Subject: [PATCH] fix-lastLogoutUser-root-bug + +--- + src/dde-lock/lockworker.cpp | 2 - + src/lightdm-deepin-greeter/greeterworker.cpp | 2 - + src/session-widgets/authinterface.cpp | 16 -------- + src/session-widgets/authinterface.h | 1 - + src/session-widgets/sessionbasemodel.cpp | 42 +++----------------- + src/session-widgets/sessionbasemodel.h | 4 -- + 6 files changed, 6 insertions(+), 61 deletions(-) + +diff --git a/src/dde-lock/lockworker.cpp b/src/dde-lock/lockworker.cpp +index 7edeaf7..22e798b 100644 +--- a/src/dde-lock/lockworker.cpp ++++ b/src/dde-lock/lockworker.cpp +@@ -81,7 +81,6 @@ void LockWorker::initConnections() + m_model->updateCurrentUser(m_lockInter->CurrentUser()); + } + }); +- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, m_model, static_cast(&SessionBaseModel::updateLastLogoutUser)); + connect(m_loginedInter, &LoginedInter::UserListChanged, m_model, &SessionBaseModel::updateLoginedUserList); + /* com.deepin.daemon.Authenticate */ + connect(m_authFramework, &DeepinAuthFramework::FramworkStateChanged, m_model, &SessionBaseModel::updateFrameworkState); +@@ -199,7 +198,6 @@ void LockWorker::initData() + { + /* com.deepin.daemon.Accounts */ + m_model->updateUserList(m_accountsInter->userList()); +- m_model->updateLastLogoutUser(m_loginedInter->lastLogoutUser()); + m_model->updateLoginedUserList(m_loginedInter->userList()); + + /* com.deepin.udcp.iam */ +diff --git a/src/lightdm-deepin-greeter/greeterworker.cpp b/src/lightdm-deepin-greeter/greeterworker.cpp +index 915fce2..65bc331 100644 +--- a/src/lightdm-deepin-greeter/greeterworker.cpp ++++ b/src/lightdm-deepin-greeter/greeterworker.cpp +@@ -120,7 +120,6 @@ void GreeterWorker::initConnections() + m_soundPlayerInter->PrepareShutdownSound(static_cast(m_model->currentUser()->uid())); + } + }); +- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, m_model, static_cast(&SessionBaseModel::updateLastLogoutUser)); + connect(m_loginedInter, &LoginedInter::UserListChanged, m_model, &SessionBaseModel::updateLoginedUserList); + /* com.deepin.daemon.Authenticate */ + connect(m_authFramework, &DeepinAuthFramework::FramworkStateChanged, m_model, &SessionBaseModel::updateFrameworkState); +@@ -257,7 +256,6 @@ void GreeterWorker::initData() + + /* com.deepin.daemon.Accounts */ + m_model->updateUserList(m_accountsInter->userList()); +- m_model->updateLastLogoutUser(m_loginedInter->lastLogoutUser()); + m_model->updateLoginedUserList(m_loginedInter->userList()); + + /* com.deepin.udcp.iam */ +diff --git a/src/session-widgets/authinterface.cpp b/src/session-widgets/authinterface.cpp +index ad8b661..38f1005 100644 +--- a/src/session-widgets/authinterface.cpp ++++ b/src/session-widgets/authinterface.cpp +@@ -92,7 +92,6 @@ void AuthInterface::onUserRemove(const QString &user) + void AuthInterface::initData() + { + onUserListChanged(m_accountsInter->userList()); +- onLastLogoutUserChanged(m_loginedInter->lastLogoutUser()); + onLoginUserListChanged(m_loginedInter->userList()); + // m_accountsInter->userList(); + // m_loginedInter->lastLogoutUser(); +@@ -110,24 +109,9 @@ void AuthInterface::initDBus() + connect(m_accountsInter, &AccountsInter::UserAdded, this, &AuthInterface::onUserAdded, Qt::QueuedConnection); + connect(m_accountsInter, &AccountsInter::UserDeleted, this, &AuthInterface::onUserRemove, Qt::QueuedConnection); + +- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, this, &AuthInterface::onLastLogoutUserChanged); + connect(m_loginedInter, &LoginedInter::UserListChanged, this, &AuthInterface::onLoginUserListChanged); + } + +-void AuthInterface::onLastLogoutUserChanged(uint uid) +-{ +- m_lastLogoutUid = uid; +- +- QList> userList = m_model->userList(); +- for (auto it = userList.constBegin(); it != userList.constEnd(); ++it) { +- if ((*it)->uid() == uid) { +- m_model->updateLastLogoutUser((*it)); +- return; +- } +- } +- +- m_model->updateLastLogoutUser(std::shared_ptr(nullptr)); +-} + + void AuthInterface::onLoginUserListChanged(const QString &list) + { +diff --git a/src/session-widgets/authinterface.h b/src/session-widgets/authinterface.h +index d01afe1..3fc1fe8 100644 +--- a/src/session-widgets/authinterface.h ++++ b/src/session-widgets/authinterface.h +@@ -54,7 +54,6 @@ public: + protected: + void initDBus(); + void initData(); +- void onLastLogoutUserChanged(uint uid); + void onLoginUserListChanged(const QString &list); + + bool checkHaveDisplay(const QJsonArray &array); +diff --git a/src/session-widgets/sessionbasemodel.cpp b/src/session-widgets/sessionbasemodel.cpp +index 9593db3..f8a43de 100644 +--- a/src/session-widgets/sessionbasemodel.cpp ++++ b/src/session-widgets/sessionbasemodel.cpp +@@ -31,7 +31,6 @@ SessionBaseModel::SessionBaseModel(QObject *parent) + , m_isUseWayland(QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) + , m_appType(AuthCommon::None) + , m_currentUser(nullptr) +- , m_lastLogoutUser(nullptr) + , m_powerAction(PowerAction::RequireNormal) + , m_currentModeState(ModeStatus::NoStatus) + , m_authProperty {false, false, Unavailable, AuthCommon::None, AuthCommon::None, 0, "", "", ""} +@@ -385,8 +384,12 @@ bool SessionBaseModel::updateCurrentUser(const QString &userJson) + qDebug("update current user, data: %s", qPrintable(userJson)); + + std::shared_ptr user_ptr = json2User(userJson); +- if (!user_ptr) +- user_ptr = m_lastLogoutUser ? m_lastLogoutUser : m_users->first(); ++ if (!user_ptr) { ++ if (m_currentUser) ++ return false; ++ ++ user_ptr = m_users->first(); ++ } + + return updateCurrentUser(user_ptr); + } +@@ -439,39 +442,6 @@ void SessionBaseModel::updateUserList(const QStringList &list) + } + emit userListChanged(m_users->values()); + } +- +-/** +- * @brief 更新上一个登录用户 +- * +- * @param uid +- */ +-void SessionBaseModel::updateLastLogoutUser(const uid_t uid) +-{ +- qDebug() << "SessionBaseModel::updateLastLogoutUser:" << uid; +- QList> userList = m_users->values(); +- auto it = std::find_if(userList.begin(), userList.end(), [uid](std::shared_ptr &user) { +- return user->uid() == uid; +- }); +- if (it != userList.end()) { +- updateLastLogoutUser(it.i->t()); +- } +-} +- +-/** +- * @brief 设置上一个登录的用户 +- * +- * @param lastLogoutUser +- */ +-void SessionBaseModel::updateLastLogoutUser(const std::shared_ptr lastLogoutUser) +-{ +- if (!lastLogoutUser.get() || m_lastLogoutUser == lastLogoutUser) { +- return; +- } +- qInfo() << "last logout user:" << lastLogoutUser->name() << lastLogoutUser->uid(); +- +- m_lastLogoutUser = lastLogoutUser; +-} +- + /** + * @brief 更新已登录用户列表 + * +diff --git a/src/session-widgets/sessionbasemodel.h b/src/session-widgets/sessionbasemodel.h +index 09e35f4..5e57249 100644 +--- a/src/session-widgets/sessionbasemodel.h ++++ b/src/session-widgets/sessionbasemodel.h +@@ -70,7 +70,6 @@ public: + ~SessionBaseModel() override; + + inline std::shared_ptr currentUser() const { return m_currentUser; } +- inline std::shared_ptr lastLogoutUser() const { return m_lastLogoutUser; } + + inline QList> loginedUserList() const { return m_loginedUsers->values(); } + inline QList> userList() const { return m_users->values(); } +@@ -165,8 +164,6 @@ public slots: + bool updateCurrentUser(const QString &userJson); + bool updateCurrentUser(const std::shared_ptr user); + void updateUserList(const QStringList &list); +- void updateLastLogoutUser(const uid_t uid); +- void updateLastLogoutUser(const std::shared_ptr lastLogoutUser); + void updateLoginedUserList(const QString &list); + /* com.deepin.daemon.Authenticate */ + void updateLimitedInfo(const QString &info); +@@ -236,7 +233,6 @@ private: + AppType m_appType; + QList> m_userList; + std::shared_ptr m_currentUser; +- std::shared_ptr m_lastLogoutUser; + QString m_sessionKey; + PowerAction m_powerAction; + ModeStatus m_currentModeState; +-- +2.27.0 + diff --git a/dde-session-shell-5.4.92.orig.tar.xz b/dde-session-shell-5.4.92.orig.tar.xz deleted file mode 100644 index 238d1c7..0000000 Binary files a/dde-session-shell-5.4.92.orig.tar.xz and /dev/null differ diff --git a/dde-session-shell-5.5.90.tar.gz b/dde-session-shell-5.5.90.tar.gz new file mode 100644 index 0000000..0dbe3c0 Binary files /dev/null and b/dde-session-shell-5.5.90.tar.gz differ diff --git a/dde-session-shell.spec b/dde-session-shell.spec index ce7783f..09724a9 100644 --- a/dde-session-shell.spec +++ b/dde-session-shell.spec @@ -1,10 +1,11 @@ Name: dde-session-shell -Version: 5.4.92 +Version: 5.5.90 Release: 1 Summary: deepin-session-shell - Deepin desktop-environment - session-shell module License: GPLv3+ -URL: http://shuttle.corp.deepin.com/cache/repos/eagle/release-candidate/RERFNS4wLjAuNzYxMA/pool/main/d/dde-session-shell/ -Source0: %{name}-%{version}.orig.tar.xz +URL: https://github.com/linuxdeepin/dde-session-shell +Source0: %{name}-%{version}.tar.gz +Patch0: 9000-fix-lastLogoutUser-root-bug.patch BuildRequires: cmake BuildRequires: dde-daemon @@ -26,6 +27,8 @@ BuildRequires: lightdm-qt5-devel BuildRequires: pam-devel BuildRequires: gtest-devel gmock BuildRequires: openssl-devel +BuildRequires: dtkgui-devel +BuildRequires: kf5-kwayland-devel Requires: lightdm Requires(post): sed @@ -35,14 +38,23 @@ Provides: lightdm-greeter = 1.2 %description deepin-session-shell - Deepin desktop-environment - session-shell module. +%package devel +Summary: Development package for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Header files for %{name}. + + %prep -%setup -q -n %{name}-%{version} +%setup -q +%patch0 -p1 %build export PATH=$PATH:%{_qt5_bindir} cmake_version=$(cmake --version | head -1 | awk '{print $3}') sed -i "s|VERSION 3.13.4|VERSION $cmake_version|g" CMakeLists.txt -%cmake +%cmake -DCMAKE_INSTALL_SYSCONFDIR=/etc %make_build %install @@ -52,19 +64,27 @@ sed -i "s|VERSION 3.13.4|VERSION $cmake_version|g" CMakeLists.txt %{_bindir}/dde-lock %{_bindir}/lightdm-deepin-greeter %attr(755,root,root) %{_bindir}/deepin-greeter -%{_sysconfdir}/deepin/greeters.d/00-xrandr -%{_sysconfdir}/deepin/greeters.d/lightdm-deepin-greeter +%{_sysconfdir}/deepin/ +%{_sysconfdir}/lightdm/deepin/ +%{_sysconfdir}/xdg/autostart/dde-lock.desktop %{_datadir}/dde-session-shell/ - -%{_sysconfdir}/deepin/greeters.d/10-cursor-theme +%{_datadir}/deepin-authentication/privileges/lightdm-deepin-greeter.conf %{_datadir}/xgreeters/lightdm-deepin-greeter.desktop %{_datadir}/dbus-1/services/com.deepin.dde.lockFront.service %{_datadir}/dbus-1/services/com.deepin.dde.shutdownFront.service %{_datadir}/applications/dde-lock.desktop %{_datadir}/glib-2.0/schemas/com.deepin.dde.session-shell.gschema.xml -%{_datadir}/deepin-authentication/privileges/lightdm-deepin-greeter.conf +%{_datadir}/dsg + +%files devel +%{_includedir}/%{name} +%{_prefix}/lib/%{name}/modules/ +%{_libdir}/cmake/DdeSessionShell/DdeSessionShellConfig.cmake %changelog +* Mon Jul 31 2023 leeffo - 5.5.90-1 +- upgrade to version 5.5.90 + * Thu Mar 30 2023 liweiganga - 5.4.92-1 - update: update to 5.4.92