!56 同步更新,修复BUG

From: @liubuguiii 
Reviewed-by: @tangjie02 
Signed-off-by: @tangjie02
This commit is contained in:
openeuler-ci-bot 2024-01-18 12:02:08 +00:00 committed by Gitee
commit 9add8e532f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 363 additions and 14 deletions

View File

@ -1,7 +1,7 @@
From 251ad1e695739b2fc16a2be2bae4830fa4f9428c Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 21 Aug 2023 17:32:45 +0800
Subject: [PATCH] fix(avatar): Update authentication users and user list
Subject: [PATCH 5/7] fix(avatar): Update authentication users and user list
avatars in real time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -271,5 +271,5 @@ index 9e45f61..e58b39c 100644
Q_SIGNALS:
void userActivated(const UserInfo &userInfo);
--
2.33.0
2.27.0

View File

@ -1,7 +1,7 @@
From c259d0223202a986deb3d2eec7567380e7895ce9 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 22 Aug 2023 11:47:25 +0800
Subject: [PATCH] fix(compile warning): Fixed some compilation warnings
Subject: [PATCH 6/7] fix(compile warning): Fixed some compilation warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -34,5 +34,5 @@ index 10fdbc5..6094a71 100644
m_switcher->setAdjustColorToTheme(true);
m_switcher->setFixedSize(QSize(42, 36));
--
2.33.0
2.27.0

View File

@ -1,7 +1,7 @@
From af28157ad311c38ab8990b1abd2b1a3041c65a22 Mon Sep 17 00:00:00 2001
From: niko_yhc <yinhongchang@kylinsec.com.cn>
Date: Tue, 12 Sep 2023 19:20:14 +0800
Subject: [PATCH] fix(kiran-session-guard):fits the Qt5.9.7 interface
Subject: [PATCH 7/7] fix(kiran-session-guard):fits the Qt5.9.7 interface
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

View File

@ -1,8 +1,8 @@
From 66d11ae4717a846e06a7fc85354993ba2e90ce0e Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 26 Oct 2023 14:40:23 +0800
Subject: [PATCH] fix(styleditemdelegate): updateEditorGeometry to update the
wrong size of ItemWidgets in QStyledItemDelegate
Subject: [PATCH 08/10] fix(styleditemdelegate): updateEditorGeometry to update
the wrong size of ItemWidgets in QStyledItemDelegate
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -114,5 +114,5 @@ index b83efdf..e59fa8b 100644
ui->userList->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->userList->setSelectionMode(QAbstractItemView::SingleSelection);
--
2.33.0
2.27.0

View File

@ -0,0 +1,135 @@
From 833ef45aa88677c2b91643d9893479b3b9dcb07c Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 9 Jan 2024 11:13:53 +0800
Subject: [PATCH 09/10] fix(autologin-timeout): Fix issues caused by automatic
login timeout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复自动登录超时时间导致的问题
Closes #25015
---
src/lightdm-greeter/frame.cpp | 70 +++++++++++++++++++++++++++++++++--
src/lightdm-greeter/frame.h | 1 +
2 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/src/lightdm-greeter/frame.cpp b/src/lightdm-greeter/frame.cpp
index beb5ae5..3d8dada 100644
--- a/src/lightdm-greeter/frame.cpp
+++ b/src/lightdm-greeter/frame.cpp
@@ -155,7 +155,7 @@ void Frame::initMenus()
// clang-format off
connect(itemWidget, &GreeterMenuItem::sigChecked, [this](QString action){
m_specifiedSession = action;
- m_sessionMenu->hide();
+ m_sessionMenu->hide();
});
// clang-format on
}
@@ -316,6 +316,7 @@ void Frame::initAuth()
{
AuthLightdm* auth = new AuthLightdm(m_greeter);
LoginFrame::initAuth(auth);
+ connect(m_greeter.data(),&QLightDM::Greeter::autologinTimerExpired,this,&Frame::onAutoLoginTimeout);
}
void Frame::initConnection()
@@ -325,8 +326,8 @@ void Frame::initConnection()
connect(m_userList, &UserList::userCountChanged, this, &Frame::onUserListUserCountChanged);
connect(m_userList, &UserList::userRemoved,this,&Frame::onUserListUserRemoved);
connect(m_btnLoginOther, &QToolButton::clicked, this, &Frame::onLoginOtherClicked);
- connect(m_btnAutoLogin, &LoginButton::sigClicked, [this](){
- startAuthUser(m_userName);
+ connect(m_btnAutoLogin, &LoginButton::sigClicked, [this](){
+ startAuthUser(m_userName);
});
// clang-format on
}
@@ -497,6 +498,69 @@ void Frame::onLoginOtherClicked()
break;
}
}
+
+static bool getIsLoggedIn(const QString& userName)
+{
+ bool res = false;
+
+ QDBusInterface dmInterface("org.freedesktop.DisplayManager",
+ "/org/freedesktop/DisplayManager",
+ "org.freedesktop.DisplayManager",
+ QDBusConnection::systemBus());
+ QVariant sessionsVar = dmInterface.property("Sessions");
+ if (!sessionsVar.isValid())
+ {
+ KLOG_ERROR("can't get display manager property 'sessions'");
+ return res;
+ }
+
+ QList<QDBusObjectPath> sessions = sessionsVar.value<QList<QDBusObjectPath>>();
+ KLOG_DEBUG() << "sessions:" << sessions.count();
+ for (const auto& session : sessions)
+ {
+ KLOG_DEBUG() << "\t-" << session.path();
+ }
+ foreach (const auto& session, sessions)
+ {
+ QDBusInterface sessionInterface("org.freedesktop.DisplayManager",
+ session.path(),
+ "org.freedesktop.DisplayManager.Session",
+ QDBusConnection::systemBus());
+ QVariant userNameVar = sessionInterface.property("UserName");
+ if (!userNameVar.isValid())
+ {
+ KLOG_ERROR("can't get display manager session property 'UserName'");
+ continue;
+ }
+
+ QString sessionUser = userNameVar.toString();
+ if (sessionUser.compare(userName) == 0)
+ {
+ res = true;
+ break;
+ }
+ }
+
+ return res;
+}
+
+void Frame::onAutoLoginTimeout()
+{
+ if (m_greeter->autologinUserHint().isEmpty())
+ {
+ return;
+ }
+
+ // NOTE:修复#52982问题若自动登录用户已存在不自动触发延时自动登录
+ bool isLogged = getIsLoggedIn(m_greeter->autologinUserHint());
+ if (isLogged)
+ {
+ return;
+ }
+
+ startAuthUser(m_greeter->autologinUserHint());
+}
+
} // namespace Greeter
} // namespace SessionGuard
} // namespace Kiran
\ No newline at end of file
diff --git a/src/lightdm-greeter/frame.h b/src/lightdm-greeter/frame.h
index 73a3532..88e51ef 100644
--- a/src/lightdm-greeter/frame.h
+++ b/src/lightdm-greeter/frame.h
@@ -72,6 +72,7 @@ private slots:
void onUserListUserCountChanged(int oldCount, int newCount);
void onUserListUserRemoved(const QString& name);
void onLoginOtherClicked();
+ void onAutoLoginTimeout();
private:
Prefs* m_prefs;
--
2.27.0

View File

@ -0,0 +1,41 @@
From c0759f25c4ebf2ed76ccd602458ea24817a4f0a3 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 9 Jan 2024 11:45:00 +0800
Subject: [PATCH 10/10] fix(scale): Fix the issue of manual scaling not taking
effect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将设置缩放率代码提前至Application构造前
Closes #25011
---
src/lightdm-greeter/main.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/lightdm-greeter/main.cpp b/src/lightdm-greeter/main.cpp
index 49911d6..61255ec 100644
--- a/src/lightdm-greeter/main.cpp
+++ b/src/lightdm-greeter/main.cpp
@@ -119,13 +119,13 @@ int main(int argc, char* argv[])
qWarning() << "init kiran-log failed";
}
- QApplication app(argc, argv);
- QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-
Prefs::globalInit();
auto prefs = Prefs::getInstance();
-
adjustScaleFactor(prefs);
+
+ QApplication app(argc, argv);
+ QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
setCursor(prefs);
loadTranslator();
loadStyleSheet();
--
2.27.0

View File

@ -0,0 +1,163 @@
From a1615021c9e2c89558338108755420077e6658e1 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Thu, 18 Jan 2024 17:15:12 +0800
Subject: [PATCH] fix(login background): Add login background setting title
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加登录背景设置标题
Closes #25063
---
.../kiran-cpanel-greeter/setting-window.cpp | 9 +++-
translations/kiran-cpanel-greeter.zh_CN.ts | 43 +++++++++++--------
2 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
index 921e27c..5c3fd15 100644
--- a/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
+++ b/src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp
@@ -154,7 +154,7 @@ QWidget *SettingWindow::initPageAutoLogin()
auto pageAutoLogin = new QWidget(this);
auto mainLayout = new QVBoxLayout(pageAutoLogin);
- mainLayout->setContentsMargins(12, 24, 12, 0);
+ mainLayout->setContentsMargins(16, 16, 16, 0);
mainLayout->setSpacing(0);
/* 自动登录用户总开关 */
@@ -263,11 +263,16 @@ QWidget *SettingWindow::initPageGeneralSettings()
{
auto pageGeneralSettings = new QWidget(this);
auto mainLayout = new QVBoxLayout(pageGeneralSettings);
- mainLayout->setContentsMargins(12, 24, 12, 0);
+ mainLayout->setContentsMargins(16, 16, 16, 0);
mainLayout->setSpacing(0);
/* 外观设置 */
/* 图片选择控件 */
+ auto titleLabel = new QLabel(this);
+ titleLabel->setText(tr("login background setting"));
+ mainLayout->addWidget(titleLabel);
+ mainLayout->addSpacerItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Fixed));
+
m_imageSelector = new KiranImageSelector(this);
m_imageSelector->setFixedHeight(148);
mainLayout->addWidget(m_imageSelector);
diff --git a/translations/kiran-cpanel-greeter.zh_CN.ts b/translations/kiran-cpanel-greeter.zh_CN.ts
index fbe76f5..5468e6f 100644
--- a/translations/kiran-cpanel-greeter.zh_CN.ts
+++ b/translations/kiran-cpanel-greeter.zh_CN.ts
@@ -110,84 +110,89 @@ Select discard to discard the modification and reload the new configuration</sou
</message>
<message>
<location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="235"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="394"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="399"/>
<source>Save</source>
<translation>保存</translation>
</message>
<message>
<location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="249"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="408"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="413"/>
<source>Reset</source>
<translation>重置</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="284"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="272"/>
+ <source>login background setting</source>
+ <translation>登录背景设置</translation>
+ </message>
+ <message>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="289"/>
<source>Scale Mode</source>
<translation>缩放模式</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="295"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="300"/>
<source>auto</source>
<translation>自动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="296"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="301"/>
<source>manual</source>
<translation>手动</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="297"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="302"/>
<source>disable</source>
<translation>禁用</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="303"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="308"/>
<source>Scale Factor</source>
<translation>缩放比例</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="328"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="333"/>
<source>Enable manual input user login</source>
<translation>允许手动输入用户名登录</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="353"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="358"/>
<source>Show User List</source>
<translation>显示用户列表</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="460"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="536"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="465"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="541"/>
<source>Configuration changed</source>
<translation>配置已改变</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="461"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="537"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="466"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="542"/>
<source>The external configuration file has changed
If you choose to save, all external changes will be overwritten
Select discard to discard the modification and reload the new configuration</source>
<translation>配置文件已被修改,如果继续保存所有额外的修改将会被覆盖,选择丢弃将丢弃所有的修改并重新加载新的配置文件</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="514"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="584"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="519"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="589"/>
<source>Save failed, reload</source>
<translation>保存失败,已重新加载</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="518"/>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="594"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="523"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="599"/>
<source>Saved successfully</source>
<translation>保存成功</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="588"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="593"/>
<source>Save failed: %1</source>
<translation>保存失败: %1</translation>
</message>
<message>
- <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="713"/>
+ <location filename="../src/lightdm-greeter/kiran-cpanel-greeter/setting-window.cpp" line="718"/>
<source>Please ensure that one of the two options is turned on!</source>
<translation>请确保两个选项之一被打开!</translation>
</message>
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: kiran-session-guard
Version: 2.5.1
Release: 7
Release: 9%{?dist}
Summary: Kiran desktop environment login and lock screen dialog
Summary(zh_CN): Kiran桌面环境登录和解锁框
@ -15,7 +15,9 @@ Patch0005: 0005-fix-avatar-Update-authentication-users-and-user-list.patch
Patch0006: 0006-fix-compile-warning-Fixed-some-compilation-warnings.patch
Patch0007: 0007-fix-kiran-session-guard-fits-the-Qt5.9.7-interface.patch
Patch0008: 0008-fix-styleditemdelegate-updateEditorGeometry-to-updat.patch
Patch0009: 0009-fix-autologin-timeout-Fix-issues-caused-by-automatic.patch
Patch0010: 0010-fix-scale-Fix-the-issue-of-manual-scaling-not-taking.patch
Patch0011: 0011-fix-login-background-Add-login-background-setting-ti.patch
%define SHOW_VIRTUAL_KEYBOARD 0
@ -153,15 +155,23 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
rm -rf %{buildroot}
%changelog
* Thu Oct 26 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-7
- KYOS-F: fix updateEditorGeometry to update the wrong size of ItemWidgets in QStyledItemDelegate(#16513)
* Thu Jan 18 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-9
- KYOS-B: fix the issue of manual scaling not taking effect(#25011)
- KYOS-B: fix issues caused by automatic login timeout(#25015)
- KYOS-B: add login background settings title(#25063)
* Tue Sep 12 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.1-6
* Thu Oct 26 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-7.kb1
- KYOS-B: fix updateEditorGeometry to update the wrong size of ItemWidgets in QStyledItemDelegate(#16513)
* Tue Sep 12 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.1-6.kb1
- KYOS-F: fits the Qt5.9.7 interface(#15019)
* Tue Aug 22 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-5
* Tue Aug 22 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-5.kb1
- KYOS-B: update authentication users and user list avatars(#12711)
* Fri Jun 16 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.1-4.kb1
- rebuild for KiranUI-2.5-next
* Tue Jun 13 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-4
- KYOS-B: fix the crash caused by the exit slot not being disconnected in time
- KYOS-B fix SIGTERM processing where there may be blocking in the X event(#I79MO4)