!62 修复在锁屏界面切换用户时左下角重复选择当前用户则无法输入密

From: @hua_yadong 
Reviewed-by: @dou33 
Signed-off-by: @dou33
This commit is contained in:
openeuler-ci-bot 2024-11-20 09:16:12 +00:00 committed by Gitee
commit f7c57dcbe8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 6b89a0dbab8b63644a25eb89e404ce2ceec24503 Mon Sep 17 00:00:00 2001
From: huayadong <huayadong@kylinos.cn>
Date: Tue, 19 Nov 2024 10:52:43 +0800
Subject: [PATCH] fix unable to input password
---
src/lockwidget.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/lockwidget.cpp b/src/lockwidget.cpp
index ac11367..582c25d 100644
--- a/src/lockwidget.cpp
+++ b/src/lockwidget.cpp
@@ -42,6 +42,7 @@
#include "commonfunc.h"
#include "hoverwidget.h"
#include "kylinnm.h"
+#include <pwd.h>
#include <QtX11Extras/QX11Info>
#include <X11/Xlib.h>
@@ -681,12 +682,18 @@ void LockWidget::onUserMenuTrigged(QAction *action)
{
qDebug() << action->data().toString() << "selected";
+ QString userName = action->data().toString();
+ struct passwd *pw = getpwuid(geteuid());
+ QString localname = QString::fromLocal8Bit(pw->pw_name);
+ if (userName.compare(localname) == 0) {
+ return;
+ }
+
if(authDialog)
{
authDialog->stopAuth();
}
- QString userName = action->data().toString();
for (int i =0; i < list.count(); i++)
{
if(list.at(i)->objectName() == userName){
--
2.46.0

View File

@ -1,6 +1,6 @@
Name: ukui-screensaver
Version: 3.1.1
Release: 7
Release: 8
Summary: Screensaver for UKUI desktop environment
License: GPL-3+ and GPL-2+
URL: http://www.ukui.org
@ -12,6 +12,8 @@ Patch03: disable-Suspend-and-Sleep-of-ukui-screensaver.patch
Patch04: add-switchuser-no-limits-in-ukui-screensaver.patch
%endif
Patch05: 0001-use-QRandomGenerator-to-generate-random-numbers.patch
Patch06: ukui-screensaver-3.1.1-fix-unable-to-input-password.patch
BuildRequires: cmake
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtx11extras-devel
@ -50,6 +52,7 @@ fi
%patch 4 -p1
%endif
%patch 5 -p1
%patch 6 -p1
%build
cmake .
@ -84,6 +87,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/ &> /dev/null ||:
%{_prefix}/lib/ukui-screensaver/screensaver-focus-helper
%changelog
* Wed Nov 20 2024 huayadong<huayadong@kylinos.cn> - 3.1.1-8
- add patch6:ukui-screensaver-3.1.1-fix-unable-to-input-password.patch
* Fri Apr 26 2024 houhongxun <houhongxun@kylinos.cn> - 3.1.1-7
- use QRandomGenerator to generate random numbers