fix(merge v101): merge v101

Description: 同步主线bug修复

Log: 无
This commit is contained in:
winnerym 2023-04-26 19:37:44 +08:00
parent 18fb67295c
commit 32e4c33cfa
8 changed files with 43 additions and 19 deletions

View File

@ -18,6 +18,7 @@ include_directories(
${Qt5Widgets_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS}
${GLIB2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}
${GIOUNIX2_INCLUDE_DIRS}
) )

View File

@ -17,7 +17,7 @@
**/ **/
#include "giodbus.h" #include "giodbus.h"
#include <gio/gio.h> #include <gio/gio.h>
#include <gio-unix-2.0/gio/gunixfdlist.h> #include <gio/gunixfdlist.h>
#include <glib.h> #include <glib.h>
int get_server_gvariant_stdout (int drvid) int get_server_gvariant_stdout (int drvid)

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/bin/bash
/usr/lib/ukui-screensaver/set4kScale >/dev/null 2>&1
ukui-screensaver-dialog --lock-startup & >/dev/null 2>&1 ukui-screensaver-dialog --lock-startup & >/dev/null 2>&1
/usr/lib/ukui-screensaver/screensaver-focus-helper & >/dev/null 2>&1 /usr/lib/ukui-screensaver/screensaver-focus-helper & >/dev/null 2>&1

View File

@ -989,7 +989,7 @@ void Screensaver::setDatelayout()
if(dateType == "cn") if(dateType == "cn")
this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期")); this->dateOfDay->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else else
this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); this->dateOfDay->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
this->dateOfDay->setObjectName("dateOfDay"); this->dateOfDay->setObjectName("dateOfDay");
this->dateOfDay->setAlignment(Qt::AlignCenter); this->dateOfDay->setAlignment(Qt::AlignCenter);
this->dateOfDay->adjustSize(); this->dateOfDay->adjustSize();
@ -1105,7 +1105,7 @@ void Screensaver::updateTime()
if(dateType == "cn") if(dateType == "cn")
this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("","星期")); this->dateOfDay->setText(curDateTime.date().toString("yyyy/MM/dd ddd").replace("","星期"));
else else
this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd")); this->dateOfDay->setText(curDateTime.date().toString("yyyy-MM-dd ddd").replace("","星期"));
m_lastDateTime = curDateTime; m_lastDateTime = curDateTime;
} }

View File

@ -123,7 +123,7 @@ void AuthDialog::initUI()
m_userWidget->setObjectName(QStringLiteral("userWidget")); m_userWidget->setObjectName(QStringLiteral("userWidget"));
/* 头像 */ /* 头像 */
const QString SheetStyle = QString("border-radius: %1px; border:0px solid white;").arg(77*scale); const QString SheetStyle = QString("border-radius: %1px; border:0px solid white;").arg((int)(77*scale));
m_labelHeadImg = new QLabel(m_userWidget); m_labelHeadImg = new QLabel(m_userWidget);
m_labelHeadImg->setObjectName(QStringLiteral("faceLabel")); m_labelHeadImg->setObjectName(QStringLiteral("faceLabel"));
m_labelHeadImg->setFocusPolicy(Qt::NoFocus); m_labelHeadImg->setFocusPolicy(Qt::NoFocus);
@ -451,17 +451,17 @@ void AuthDialog::setChildrenGeometry()
width(), 376*scale); width(), 376*scale);
m_labelLoginTypeTip->setGeometry(0,0,m_userWidget->width(), 30); m_labelLoginTypeTip->setGeometry(0,0,m_userWidget->width(), 30);
m_labelLoginTypeTip->setAlignment(Qt::AlignCenter); m_labelLoginTypeTip->setAlignment(Qt::AlignCenter);
m_labelHeadImg->setStyleSheet(QString("border-radius: %1px; border:0px solid white;").arg(77*scale)); m_labelHeadImg->setStyleSheet(QString("border-radius: %1px; border:0px solid white;").arg((int)(77*scale)));
m_labelHeadImg->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); m_labelHeadImg->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale);
QPixmap facePixmap = makeRoundLogo(user.icon, 154*scale, 154*scale, 77*scale); QPixmap facePixmap = makeRoundLogo(user.icon, 154*scale, 154*scale, 77*scale);
m_labelHeadImg->setPixmap(facePixmap); m_labelHeadImg->setPixmap(facePixmap);
m_labelQRCode->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,100%);").arg(6*scale)); m_labelQRCode->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,100%);").arg((int)(6*scale)));
m_labelQRCode->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); m_labelQRCode->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale);
setQRCode(m_imgQRCode); setQRCode(m_imgQRCode);
m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg(77*scale)); m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg((int)(77*scale)));
m_labelFace->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale); m_labelFace->setGeometry((width() - 154*scale) / 2 , m_labelLoginTypeTip->geometry().bottom()+24*scale, 154*scale, 154*scale);
QImage faceImg; QImage faceImg;
setFaceImg(faceImg); setFaceImg(faceImg);
@ -1074,6 +1074,12 @@ void AuthDialog::performBiometricAuth()
{ {
qWarning() << "No available devices"; qWarning() << "No available devices";
skipBiometricAuth(); skipBiometricAuth();
if (m_deviceInfo) {
if (!m_widgetLoginOpts || !m_widgetLoginOpts->findDeviceById(m_deviceInfo->id)
|| m_widgetLoginOpts->isDeviceDisable(m_deviceInfo->id)) {
m_deviceInfo = DeviceInfoPtr();
}
}
return; return;
} }
@ -1386,7 +1392,7 @@ void AuthDialog::setFaceImg(QImage& imgFace, int nStatus)
break; break;
case 2: case 2:
faceImage = m_widgetLoginOpts->loadSvg(":/image/assets/ukui-loginopt-smile.svg", "gray", 48); faceImage = m_widgetLoginOpts->loadSvg(":/image/assets/ukui-loginopt-smile.svg", "gray", 48);
m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,20%);").arg(77*scale)); m_labelFace->setStyleSheet(QString("border-radius: %1px; border:0px solid white;background-color: rgba(255,255,255,10%);").arg((int)(77*scale)));
break; break;
default: default:
faceImage = QPixmap(":/image/assets/ukui-loginopt-smile.svg"); faceImage = QPixmap(":/image/assets/ukui-loginopt-smile.svg");
@ -1467,6 +1473,9 @@ void AuthDialog::onLoginOptsCount(unsigned uCount, bool is_bioBtn)
if(m_widgetLoginOpts->getLoginOptCount() < 1) if(m_widgetLoginOpts->getLoginOptCount() < 1)
{ {
qWarning() << "No available devices"; qWarning() << "No available devices";
if (m_deviceInfo) {
m_deviceInfo = DeviceInfoPtr();
}
return; return;
} }
@ -1592,6 +1601,12 @@ void AuthDialog::onBiometricDbusChanged(bool bActive)
if(m_widgetLoginOpts->getLoginOptCount() < 1) if(m_widgetLoginOpts->getLoginOptCount() < 1)
{ {
qWarning() << "No available devices"; qWarning() << "No available devices";
if (m_deviceInfo) {
if (!m_widgetLoginOpts || !m_widgetLoginOpts->findDeviceById(m_deviceInfo->id)
|| m_widgetLoginOpts->isDeviceDisable(m_deviceInfo->id)) {
m_deviceInfo = DeviceInfoPtr();
}
}
return; return;
} }

View File

@ -61,8 +61,8 @@
#define TIME_TYPE_SCHEMA "org.ukui.control-center.panel.plugins" #define TIME_TYPE_SCHEMA "org.ukui.control-center.panel.plugins"
#define CONFIG_FILE "/etc/lightdm/ukui-greeter.conf" #define CONFIG_FILE "/etc/lightdm/ukui-greeter.conf"
#define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}" #define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}"
#define ON_NORMAL_SHEET "QPushButton{text-align:center;color: rgb(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ #define ON_NORMAL_SHEET "QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \
QPushButton::hover{background-color: rgb(255,255,255,15%);} \ QPushButton::hover{background-color: rgba(255,255,255,15%);} \
QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\
QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}" QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}"
float scale; float scale;
@ -709,7 +709,7 @@ void LockWidget::initUI()
if(dateType == "cn") if(dateType == "cn")
ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期")); ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else else
ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
}); });
if(timeType == 12) if(timeType == 12)
@ -728,7 +728,7 @@ void LockWidget::initUI()
if(dateType == "cn") if(dateType == "cn")
ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期")); ui->lblDate->setText(QDate::currentDate().toString("yyyy/MM/dd ddd").replace("","星期"));
else else
ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd")); ui->lblDate->setText(QDate::currentDate().toString("yyyy-MM-dd ddd").replace("","星期"));
ui->lblDate->setFontSize(18); ui->lblDate->setFontSize(18);
ui->lblDate->setAlignment(Qt::AlignCenter); ui->lblDate->setAlignment(Qt::AlignCenter);
@ -801,8 +801,8 @@ void LockWidget::initUI()
// }); // });
btnNetworkManager = new KyNetworkIcon(this); btnNetworkManager = new KyNetworkIcon(this);
btnNetworkManager->setStyleSheet("QPushButton{text-align:center;color: rgb(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \ btnNetworkManager->setStyleSheet("QPushButton{text-align:center;color: rgba(255, 255, 255, 255);border: none;border-radius: 4px;outline: none;} \
QPushButton::hover{background-color: rgb(255,255,255,15%);} \ QPushButton::hover{background-color: rgba(255,255,255,15%);} \
QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\
QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}"); QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}");
btnNetworkManager->setCheckable(true); btnNetworkManager->setCheckable(true);

View File

@ -42,7 +42,7 @@
#define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}" #define ON_TAB_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: 2px solid #2C73C8;}"
#define ON_NORMAL_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: none;}\ #define ON_NORMAL_SHEET "QPushButton{background-color: rgba(255,255,255,15%); border-radius: 4px; border: none;}\
QPushButton::hover{ background-color: rgb(255,255,255,40%);}\ QPushButton::hover{ background-color: rgba(255,255,255,40%);}\
QPushButton::pressed {background-color: rgba(255,255,255,40%);}\ QPushButton::pressed {background-color: rgba(255,255,255,40%);}\
QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}" QPushButton::checked {background-color: rgba(255, 255, 255, 40%);}"

View File

@ -30,7 +30,8 @@
#include "rootWindowBackground.h" #include "rootWindowBackground.h"
Pixmap pix; static const XID INVAL_ID = ~0UL;
Pixmap pix = INVAL_ID;
Display *dpy = NULL; Display *dpy = NULL;
Window root = 0; Window root = 0;
Screen *scn = NULL; Screen *scn = NULL;
@ -189,6 +190,10 @@ void setRootWindowBackground(bool type,unsigned int color,char *filename, int nO
if(!root) if(!root)
root = DefaultRootWindow(dpy); root = DefaultRootWindow(dpy);
if (pix != INVAL_ID) {
XFreePixmap(dpy, pix);
pix = INVAL_ID;
}
pix = XCreatePixmap(dpy, root, width, height, pix = XCreatePixmap(dpy, root, width, height,
DefaultDepthOfScreen(scn)); DefaultDepthOfScreen(scn));
@ -385,7 +390,8 @@ void drawBackground(bool isDraw)
return ; return ;
} }
if (isDraw) { if (isDraw) {
XSetWindowBackgroundPixmap(dpy, root, pix); if (pix != INVAL_ID)
XSetWindowBackgroundPixmap(dpy, root, pix);
XClearWindow(dpy, root); XClearWindow(dpy, root);
} }
@ -393,7 +399,10 @@ void drawBackground(bool isDraw)
XEvent ev; XEvent ev;
XNextEvent(dpy, &ev); XNextEvent(dpy, &ev);
} }
XFreePixmap(dpy, pix); if (pix != INVAL_ID) {
XFreePixmap(dpy, pix);
pix = INVAL_ID;
}
XCloseDisplay(dpy); XCloseDisplay(dpy);
dpy = NULL; dpy = NULL;
} }