From 74170865608409b689d1331ad5cb2102304d078e Mon Sep 17 00:00:00 2001 From: liudun Date: Wed, 28 Jun 2023 15:17:45 +0800 Subject: [PATCH] fix(The bottom icon will be covered): After closing the cover, open the cover, and the icon below will be covered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: After closing the cover, open the cover, and the icon below will be covered Log: 合盖后开盖,锁屏下方图标会被遮住 Bug: bug#I69CSS【锁屏】合盖后重新打开进入锁屏,此时锁屏界面下方图标会被遮住 --- CMakeLists.txt | 1 + debian/changelog | 8 ++++++++ debian/control | 4 +++- src/CMakeLists.txt | 1 + src/fullbackgroundwidget.cpp | 12 ++++++------ src/ukui-screensaver-dialog.cpp | 17 +++++++++++++---- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0aa1a46..2a8cc61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ find_package(OpenCV REQUIRED) find_package(PkgConfig) find_package(KF5Screen REQUIRED) find_package(KF5Wayland REQUIRED) +find_package(LayerShellQt REQUIRED) pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0) pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0) diff --git a/debian/changelog b/debian/changelog index 88b438a..c7e8201 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ukui-screensaver (4.0.0.0-ok3~0628) yangtze; urgency=medium + + * BUG号:bug#I69CSS【锁屏】合盖后重新打开进入锁屏,此时锁屏界面下方图标会被遮住 + * 需求号:无 + * 其他修改说明:无 + + -- liudun Wed, 28 Jun 2023 15:05:12 +0800 + ukui-screensaver (4.0.0.0-ok3~0608) yangtze; urgency=medium * BUG号:无 diff --git a/debian/control b/debian/control index 3042ad2..67aa1b5 100644 --- a/debian/control +++ b/debian/control @@ -30,7 +30,8 @@ Build-Depends: debhelper-compat (= 12), libkysdk-sysinfo-dev (>> 1.1.0kylin1), ukui-input-gather (>=1.0.0.2), libinput-dev, - libukuiinputgatherclient-dev + libukuiinputgatherclient-dev, + layer-shell-qt Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://www.github.com/ukui/ukui-screensaver @@ -44,6 +45,7 @@ Depends: ethtool, ukui-session-manager, libpam-biometric(>=3.20.0.10), ukui-input-gather(>=1.0.0.2), + layer-shell-qt, ${misc:Depends}, ${shlibs:Depends} Replaces: ukui-screensaver-common (<< 2.0.0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d22a516..c30a4e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -199,6 +199,7 @@ target_link_libraries(ukui-screensaver-dialog opencv_imgcodecs opencv_imgproc opencv_core + LayerShellQt::Interface ) link_libraries(libmatemixer.so glib-2.0.so) diff --git a/src/fullbackgroundwidget.cpp b/src/fullbackgroundwidget.cpp index ae7695d..5ab2976 100644 --- a/src/fullbackgroundwidget.cpp +++ b/src/fullbackgroundwidget.cpp @@ -365,9 +365,9 @@ bool FullBackgroundWidget::eventFilter(QObject *obj, QEvent *event) if(event->type() == QEvent::WindowDeactivate){ QTimer::singleShot(50,this,SLOT(laterActivate())); }else if(event->type() == QEvent::WindowActivate){ - if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) { - PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); - } +// if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) { +// PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); +// } QTimer::singleShot(500,this,SLOT(setLockState())); QTimer::singleShot(200,this,SLOT(killWindow())); @@ -1222,9 +1222,9 @@ void FullBackgroundWidget::onDesktopResized() update(); #endif - if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11() ) { - PlasmaShellManager::getInstance()->setPos(this->windowHandle(),QPoint(0,0)); - } +// if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11() ) { +// PlasmaShellManager::getInstance()->setPos(this->windowHandle(),QPoint(0,0)); +// } } void FullBackgroundWidget::laterInhibit(bool val) diff --git a/src/ukui-screensaver-dialog.cpp b/src/ukui-screensaver-dialog.cpp index 9443b8a..8626b4c 100644 --- a/src/ukui-screensaver-dialog.cpp +++ b/src/ukui-screensaver-dialog.cpp @@ -45,6 +45,7 @@ #define MAX_FILE_SIZE 1024 * 1024 #define LOG_FILE0 "screensaver_0.log" #define LOG_FILE1 "screensaver_1.log" +#include #define GSETTINGS_SCHEMA_SCREENSAVER "org.ukui.screensaver" #define KEY_LOCK_ENABLED "lock-enabled" @@ -131,6 +132,8 @@ void handler(int signum) #define WORKING_DIRECTORY "/usr/share/ukui-screensaver" int main(int argc, char *argv[]) { + LayerShellQt::Shell::useLayerShell(); + if(argc < 2) return 0; @@ -301,11 +304,17 @@ int main(int argc, char *argv[]) if(QString(qgetenv("XDG_SESSION_TYPE")) == "wayland" && !QX11Info::isPlatformX11()) { isWayland = true; } - if (isWayland){ - PlasmaShellManager::getInstance(); - PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); +// if (isWayland){ +// PlasmaShellManager::getInstance(); +// PlasmaShellManager::getInstance()->setAppWindowKeepAbove(true); +// } + if (isWayland) { + if (auto layerShellWindow = LayerShellQt::Window::get(window->windowHandle())) { + layerShellWindow->setExclusiveZone(-1); + layerShellWindow->setLayer(LayerShellQt::Window::LayerOverlay); + layerShellWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityExclusive); + } } - QString username = getenv("USER"); int uid = getuid(); QDBusInterface *interface = new QDBusInterface("cn.kylinos.Kydroid2",