fixbug#278787、#277875

This commit is contained in:
yangmin100 2024-10-31 15:40:25 +08:00
parent 1b9bb71109
commit c3d3c3271a
4 changed files with 10 additions and 4 deletions

View File

@ -379,7 +379,7 @@ void AuthDialog::initEditWidget()
QHBoxLayout *msgBtnLayout = new QHBoxLayout(); QHBoxLayout *msgBtnLayout = new QHBoxLayout();
msgBtnLayout->setContentsMargins(0, 0, 0, 0); msgBtnLayout->setContentsMargins(0, 0, 0, 0);
m_messageButton->setStyleSheet( m_messageButton->setStyleSheet(
"QPushButton{text-align:center;background-color: rgba(255,255,255,15%);border: none;border-radius: 4px;outline: none;} \ "QPushButton{text-align:center;color:white;background-color: rgba(255,255,255,15%);border: none;border-radius: 4px;outline: none;} \
QPushButton::hover{background-color: rgba(255,255,255,40%);} \ QPushButton::hover{background-color: rgba(255,255,255,40%);} \
QPushButton::pressed {background-color: rgba(255,255,255,30%);}"); QPushButton::pressed {background-color: rgba(255,255,255,30%);}");
m_messageButton->hide(); m_messageButton->hide();

View File

@ -142,7 +142,7 @@ void FullBackgroundWidget::initUI()
setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
// 登录模式下监听屏幕插拔 // 登录模式下监听屏幕插拔
if (isGreeterMode()) { if (isGreeterMode() && QString(qgetenv("XDG_SESSION_TYPE")) != "wayland") {
XRRQueryExtension(QX11Info::display(), &m_RREventBase, &m_RRErrorBase); XRRQueryExtension(QX11Info::display(), &m_RREventBase, &m_RRErrorBase);
XRRSelectInput(QX11Info::display(), QX11Info::appRootWindow(), RRScreenChangeNotifyMask); XRRSelectInput(QX11Info::display(), QX11Info::appRootWindow(), RRScreenChangeNotifyMask);
QtConcurrent::run([=]() { RRScreenChangeEvent(true); }); QtConcurrent::run([=]() { RRScreenChangeEvent(true); });
@ -797,7 +797,7 @@ bool FullBackgroundWidget::nativeEventFilter(const QByteArray &eventType, void *
qDebug() << "---------------------XCB_KEY_RELEASE:" << xc->detail; qDebug() << "---------------------XCB_KEY_RELEASE:" << xc->detail;
onGlobalKeyRelease(xc->detail); onGlobalKeyRelease(xc->detail);
} else if (responseType == m_RREventBase + RRScreenChangeNotify) { } else if (responseType == m_RREventBase + RRScreenChangeNotify) {
if (isGreeterMode()) { if (isGreeterMode() && QString(qgetenv("XDG_SESSION_TYPE")) != "wayland") {
RRScreenChangeEvent(false); RRScreenChangeEvent(false);
} }
} }

View File

@ -28,6 +28,8 @@
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QTimer>
#include <QApplication> #include <QApplication>
#include <QRegExp>
#include <QRegExpValidator>
#include "commonfunc.h" #include "commonfunc.h"
#include "utils.h" #include "utils.h"
@ -85,7 +87,10 @@ IconEdit::IconEdit(LockDialogModel *model, QWidget *parent) : QWidget(parent), m
// }); // });
m_edit->setAttribute(Qt::WA_InputMethodEnabled, false); // 禁用输入法 m_edit->setAttribute(Qt::WA_InputMethodEnabled, false); // 禁用输入法
m_edit->setContextMenuPolicy(Qt::NoContextMenu); // 禁用右键菜单 QRegExp inputRegExp("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\/?:;\"'|\{} ]+$");
QRegExpValidator *inputLimits = new QRegExpValidator(inputRegExp, this);
m_edit->setValidator(inputLimits);
m_edit->setContextMenuPolicy(Qt::NoContextMenu); // 禁用右键菜单
m_edit->installEventFilter(this); m_edit->installEventFilter(this);
m_iconButton->setFocusPolicy(Qt::TabFocus); m_iconButton->setFocusPolicy(Qt::TabFocus);
m_iconButton->installEventFilter(this); m_iconButton->installEventFilter(this);

View File

@ -39,6 +39,7 @@ public:
{ {
MODULETYPE_AUTH, MODULETYPE_AUTH,
MODULETYPE_TOOL, MODULETYPE_TOOL,
MODULETYPE_WINDOW,
MODULETYPE_NOTIFY, MODULETYPE_NOTIFY,
MODULETYPE_MAX MODULETYPE_MAX
}; };