Merge pull request !37 from 杨敏/openkylin/yangtze
This commit is contained in:
杨敏 2023-08-08 01:44:46 +00:00 committed by Gitee
commit 004330d699
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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"