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,12 +1105,14 @@ void FullBackgroundWidget::onGlobalKeyRelease(int key)
// 键盘上的num_lock生效、不需要登录界面进行管理
}
#else
if (QX11Info::isPlatformX11()) {
if (key == 65) { // "Space"
if (lockWidget && lockWidget->isVisible()) {/*keyReleaseEvent有时候监听不到Space的按键事件 原因未知
Space按键放到nativeEventFilter里面*/
lockWidget->key_enter_release(Qt::Key_Space);
}
} else if (key == Qt::Key_Escape && screenStatus == SCREEN_LOCK) { // "escape"
}
if (key == 9 && screenStatus == SCREEN_LOCK) { // "escape"
bool canShow = true;
if (lockWidget && !lockWidget->exitSubWidget())
canShow = false;
@ -1123,6 +1125,21 @@ void FullBackgroundWidget::onGlobalKeyRelease(int key)
} 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,6 +1604,7 @@ void LockWidget::initUserMenu()
void LockWidget::keyReleaseEvent(QKeyEvent *e)
{
if (!QX11Info::isPlatformX11())
Q_EMIT keyGlobalRelease(e->key());
/* if (e->key() == 9) { // "Escape"