fixbug:#I7JFT2

This commit is contained in:
fengzhaoxiang 2023-08-08 09:42:50 +08:00
parent 82257a145f
commit 17a801769e
2 changed files with 35 additions and 17 deletions

View File

@ -1105,23 +1105,40 @@ void FullBackgroundWidget::onGlobalKeyRelease(int key)
// 键盘上的num_lock生效、不需要登录界面进行管理
}
#else
if (key == 65) { // "Space"
if (lockWidget && lockWidget->isVisible()) {/*keyReleaseEvent有时候监听不到Space的按键事件 原因未知
Space按键放到nativeEventFilter里面*/
lockWidget->key_enter_release(Qt::Key_Space);
if (QX11Info::isPlatformX11()) {
if (key == 65) { // "Space"
if (lockWidget && lockWidget->isVisible()) {/*keyReleaseEvent有时候监听不到Space的按键事件 原因未知
Space按键放到nativeEventFilter里面*/
lockWidget->key_enter_release(Qt::Key_Space);
}
}
if (key == 9 && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
} else {
if (key == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
} else if (key == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
if (configuration && configuration->idledelay() == -1)
canShow = false;
if (!m_isAlreadyShowSaver)
canShow = false;
if (canShow)
showScreensaver();
} else if (screenStatus & SCREEN_SAVER && !isBlank) {
clearScreensavers();
}
#endif
}

View File

@ -1604,7 +1604,8 @@ void LockWidget::initUserMenu()
void LockWidget::keyReleaseEvent(QKeyEvent *e)
{
Q_EMIT keyGlobalRelease(e->key());
if (!QX11Info::isPlatformX11())
Q_EMIT keyGlobalRelease(e->key());
/* if (e->key() == 9) { // "Escape"