From f5a274140d195d0a74c9bff53447bca5d77f6e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=BF=9C=E9=B9=8F?= <11195448+liuyuanpeng176@user.noreply.gitee.com> Date: Mon, 20 Jun 2022 02:43:12 +0000 Subject: [PATCH] =?UTF-8?q?!2=20=E4=BF=AE=E5=A4=8Dwayland=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=80=E5=87=BA=E5=B1=8F=E4=BF=9D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fullbackgroundwidget.cpp | 10 +++++++++- src/ukui-screensaver-dialog.cpp | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/fullbackgroundwidget.cpp b/src/fullbackgroundwidget.cpp index 847d022..fcb7354 100644 --- a/src/fullbackgroundwidget.cpp +++ b/src/fullbackgroundwidget.cpp @@ -364,10 +364,18 @@ void FullBackgroundWidget::setLockState() bool FullBackgroundWidget::eventFilter(QObject *obj, QEvent *event) { + if(event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseMove || event->type() == 6){ + if(screenStatus & SCREEN_SAVER){ + clearScreensavers(); + } + } if(event->type() == QEvent::WindowDeactivate){ QTimer::singleShot(50,this,SLOT(laterActivate())); }else if(event->type() == QEvent::WindowActivate){ - PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); + if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") { + PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); + } + QTimer::singleShot(500,this,SLOT(setLockState())); QTimer::singleShot(200,this,SLOT(killWindow())); } diff --git a/src/ukui-screensaver-dialog.cpp b/src/ukui-screensaver-dialog.cpp index 5bdace1..3d895e8 100644 --- a/src/ukui-screensaver-dialog.cpp +++ b/src/ukui-screensaver-dialog.cpp @@ -139,7 +139,6 @@ int main(int argc, char *argv[]) checkIslivecd(); qputenv("QT_QPA_PLATFORMTHEME",QByteArray("ukui")); - #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); @@ -209,7 +208,7 @@ int main(int argc, char *argv[]) } #ifndef USE_INTEL - window->show(); + window->showFullScreen(); window->activateWindow(); #endif if(parser.isSet(lockOption))