164 lines
5.7 KiB
Diff
164 lines
5.7 KiB
Diff
From: =?utf-8?b?5p2o5pWP?= <yangmin@kylinos.cn>
|
|
Date: Wed, 22 Nov 2023 10:01:23 +0000
|
|
Subject: =?utf-8?b?ITQ4IOS/ruaUueeql+WPo+exu+WeiyBNZXJnZSBwdWxsIHJlcXVlc3Qg?=
|
|
=?utf-8?b?ITQ4IGZyb20ga3lsaW4temV4eS9vcGVua3lsaW4vbmlsZQ==?=
|
|
|
|
---
|
|
src/CMakeLists.txt | 11 ++--------
|
|
src/lock-dialog/main.cpp | 18 -----------------
|
|
src/lock-focushelper/blackwindow.cpp | 39 +-----------------------------------
|
|
src/widgets/fullbackgroundwidget.cpp | 5 +++--
|
|
4 files changed, 6 insertions(+), 67 deletions(-)
|
|
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index eb8493e..2c6f650 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -1,12 +1,8 @@
|
|
find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg Multimedia MultimediaWidgets)
|
|
find_package(PkgConfig REQUIRED)
|
|
find_package(OpenCV REQUIRED)
|
|
-find_package(LayerShellQt)
|
|
find_package(KF5Wayland CONFIG)
|
|
-
|
|
-if(LayerShellQt_FOUND)
|
|
- add_definitions(-DHAVE_LAYERSHELLQT=1)
|
|
-endif()
|
|
+find_package(KF5WindowSystem)
|
|
|
|
pkg_check_modules(GIOUNIX2 REQUIRED gio-unix-2.0)
|
|
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
|
@@ -124,6 +120,7 @@ target_link_libraries(ukui-screensaver-dialog
|
|
Qt5::Network
|
|
Qt5::Widgets
|
|
KF5::WaylandClient
|
|
+ KF5::WindowSystem
|
|
${KYSDKSYSTIME_LIBRARIES}
|
|
${EXTRA_LIBS}
|
|
VirtualKeyboard
|
|
@@ -136,10 +133,6 @@ target_link_libraries(ukui-screensaver-dialog
|
|
-lcrypto
|
|
)
|
|
|
|
-if(LayerShellQt_FOUND)
|
|
- target_link_libraries(ukui-screensaver-dialog LayerShellQt::Interface)
|
|
-endif()
|
|
-
|
|
qt5_add_dbus_adaptor(backend_SRC
|
|
lock-backend/org.ukui.ScreenSaver.xml
|
|
lock-backend/dbusupperinterface.h
|
|
diff --git a/src/lock-dialog/main.cpp b/src/lock-dialog/main.cpp
|
|
index 2aa5163..a55d8bc 100644
|
|
--- a/src/lock-dialog/main.cpp
|
|
+++ b/src/lock-dialog/main.cpp
|
|
@@ -22,10 +22,6 @@
|
|
#include <QLocale>
|
|
#include <QDir>
|
|
|
|
-#ifdef HAVE_LAYERSHELLQT
|
|
-#include <LayerShellQt/Shell>
|
|
-#endif
|
|
-
|
|
#include <QCommandLineParser>
|
|
#include <QCommandLineOption>
|
|
#include <QDebug>
|
|
@@ -62,10 +58,6 @@ int main(int argc, char *argv[])
|
|
checkIslivecd();
|
|
}
|
|
|
|
-#ifdef HAVE_LAYERSHELLQT
|
|
- LayerShellQt::Shell::useLayerShell();
|
|
-#endif
|
|
-
|
|
qputenv("QT_QPA_PLATFORMTHEME",QByteArray("ukui"));
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
|
|
@@ -196,16 +188,6 @@ int main(int argc, char *argv[])
|
|
Q_EMIT lockDialogModel->showScreensaver();
|
|
}
|
|
|
|
-#ifdef HAVE_LAYERSHELLQT
|
|
- if(lockDialogModel->isUseWayland()){
|
|
- if (auto layerShellWindow = LayerShellQt::Window::get(window->windowHandle())) {
|
|
- layerShellWindow->setExclusiveZone(-1);
|
|
- layerShellWindow->setLayer(LayerShellQt::Window::LayerOverlay);
|
|
- layerShellWindow->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityExclusive);
|
|
- }
|
|
- }
|
|
-#endif
|
|
-
|
|
KillFocusOfKydroid();
|
|
|
|
return app.exec();
|
|
diff --git a/src/lock-focushelper/blackwindow.cpp b/src/lock-focushelper/blackwindow.cpp
|
|
index 52f270e..b662bff 100644
|
|
--- a/src/lock-focushelper/blackwindow.cpp
|
|
+++ b/src/lock-focushelper/blackwindow.cpp
|
|
@@ -52,42 +52,5 @@ bool BlackWindow::eventFilter(QObject *obj, QEvent *event)
|
|
|
|
bool BlackWindow::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
|
|
{
|
|
- if (qstrcmp(eventType, "xcb_generic_event_t") != 0 || screensaverIsShow) {
|
|
- return false;
|
|
- }
|
|
- xcb_generic_event_t *event = reinterpret_cast<xcb_generic_event_t*>(message);
|
|
- const uint8_t responseType = event->response_type & ~0x80;
|
|
- if (responseType == XCB_CONFIGURE_NOTIFY) {
|
|
- xcb_configure_notify_event_t *xc = reinterpret_cast<xcb_configure_notify_event_t*>(event);
|
|
- if(xc->window == winId())
|
|
- return false;
|
|
- XWindowAttributes window_attributes;
|
|
- XGetWindowAttributes (QX11Info::display(), xc->window,&window_attributes);
|
|
- XClassHint ch;
|
|
- ch.res_name = NULL;
|
|
- ch.res_class = NULL;
|
|
- XGetClassHint (QX11Info::display(), xc->window, &ch);
|
|
- if(QString(ch.res_name) == "ukui-screensaver-dialog"){
|
|
- // screensaverIsShow = true;
|
|
- return false;
|
|
- }
|
|
-
|
|
- laterActivate();
|
|
- }else if(responseType == XCB_MAP_NOTIFY){
|
|
- xcb_map_notify_event_t *xm = reinterpret_cast<xcb_map_notify_event_t*>(event);
|
|
- if(xm->window == winId())
|
|
- return false;
|
|
- XWindowAttributes window_attributes;
|
|
- XGetWindowAttributes (QX11Info::display(), xm->window,&window_attributes);
|
|
- XClassHint ch;
|
|
- ch.res_name = NULL;
|
|
- ch.res_class = NULL;
|
|
- XGetClassHint (QX11Info::display(), xm->window, &ch);
|
|
- if(QString(ch.res_name) == "ukui-screensaver-dialog"){
|
|
- // screensaverIsShow = true;
|
|
- return false;
|
|
- }
|
|
- laterActivate();
|
|
- }
|
|
- return false;
|
|
+ return false;
|
|
}
|
|
diff --git a/src/widgets/fullbackgroundwidget.cpp b/src/widgets/fullbackgroundwidget.cpp
|
|
index 62f503f..32967b9 100644
|
|
--- a/src/widgets/fullbackgroundwidget.cpp
|
|
+++ b/src/widgets/fullbackgroundwidget.cpp
|
|
@@ -39,6 +39,7 @@
|
|
#include <X11/Xutil.h>
|
|
#include <QPainter>
|
|
#include <QScreen>
|
|
+#include <KWindowSystem>
|
|
#include "commonfunc.h"
|
|
#include "screensavermode.h"
|
|
#include "screensaverwidget.h"
|
|
@@ -121,8 +122,8 @@ void FullBackgroundWidget::initUI()
|
|
}
|
|
}
|
|
|
|
- setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint
|
|
- | Qt::X11BypassWindowManagerHint);
|
|
+ setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
|
|
+ KWindowSystem::setType(this->winId(), NET::ScreenLock);
|
|
|
|
qApp->installNativeEventFilter(this);
|
|
installEventFilter(this);
|