Merge pull request !85 from 杨敏/openkylin/nile
This commit is contained in:
杨敏 2024-06-03 10:08:07 +00:00 committed by openkylin-cibot
parent 8c8c297df6
commit 92e2854c47
3 changed files with 126 additions and 0 deletions

1
debian/control vendored
View File

@ -35,6 +35,7 @@ Build-Depends: debhelper-compat (= 12),
libavformat-dev,
qtmultimedia5-dev,
libkysdk-systime-dev,
libkysdk-waylandhelper-dev,
liblightdm-qt5-3-dev,
libsystemd-dev,
libssl-dev,

124
debian/patches/0033-85-fixbug.patch vendored Normal file
View File

@ -0,0 +1,124 @@
From: =?utf-8?b?5p2o5pWP?= <yangmin@kylinos.cn>
Date: Mon, 3 Jun 2024 10:08:07 +0000
Subject: =?utf-8?q?!85_fixbug_Merge_pull_request_!85_from_=E6=9D=A8?=
=?utf-8?q?=E6=95=8F/openkylin/nile?=
---
src/CMakeLists.txt | 6 ++++--
src/lock-backend/main.cpp | 8 +++++++-
src/lock-dialog/main.cpp | 8 +++++++-
src/widgets/fullbackgroundwidget.cpp | 11 ++++++++---
4 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 00a754b..5f19b20 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,6 +9,7 @@ pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
find_package(X11 REQUIRED)
pkg_check_modules(KYSDKSYSTIME REQUIRED kysdk-systime)
+pkg_check_modules(KYSDKWAYLANDHELPER REQUIRED kysdk-waylandhelper)
pkg_check_modules(XTST REQUIRED xtst)
pkg_check_modules(XCB REQUIRED xcb)
pkg_check_modules(QGS REQUIRED gsettings-qt)
@@ -115,8 +116,8 @@ set(dialog_SRC
)
add_executable(ukui-screensaver-dialog ${dialog_SRC})
add_definitions(-DAPP_API_MAJOR=0 -DAPP_API_MINOR=11 -DAPP_API_FUNC=0)
-target_include_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_INCLUDE_DIRS})
-target_link_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_LIBRARY_DIRS})
+target_include_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_INCLUDE_DIRS} ${KYSDKWAYLANDHELPER_INCLUDE_DIRS})
+target_link_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_LIBRARY_DIRS} ${KYSDKWAYLANDHELPER_LIBRARY_DIRS})
target_link_libraries(ukui-screensaver-dialog
Qt5::Core
Qt5::Widgets
@@ -128,6 +129,7 @@ target_link_libraries(ukui-screensaver-dialog
KF5::WaylandClient
KF5::WindowSystem
${KYSDKSYSTIME_LIBRARIES}
+ ${KYSDKWAYLANDHELPER_LIBRARIES}
${EXTRA_LIBS}
VirtualKeyboard
Screensaver
diff --git a/src/lock-backend/main.cpp b/src/lock-backend/main.cpp
index 1b2dcc7..27916bc 100644
--- a/src/lock-backend/main.cpp
+++ b/src/lock-backend/main.cpp
@@ -38,7 +38,13 @@ int main(int argc, char *argv[])
initUkuiLog4qt("ukui-screensaver-backend");
// 重启或关机时不被session关掉
qunsetenv("SESSION_MANAGER");
- QString singleId = QString("ukui-screensaver-backend"+QLatin1String(getenv("DISPLAY")));
+ QString strDisplay = "";
+ if (QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
+ strDisplay = QLatin1String(getenv("WAYLAND_DISPLAY"));
+ } else {
+ strDisplay = QLatin1String(getenv("DISPLAY"));
+ }
+ QString singleId = QString("ukui-screensaver-backend"+strDisplay);
QtSingleCoreApplication a(singleId, argc, argv);
if (a.isRunning()) {
qDebug() << "There is an instance running";
diff --git a/src/lock-dialog/main.cpp b/src/lock-dialog/main.cpp
index 6a7dfac..7469e11 100644
--- a/src/lock-dialog/main.cpp
+++ b/src/lock-dialog/main.cpp
@@ -77,7 +77,13 @@ int main(int argc, char *argv[])
if (isGreeterMode())
DisplayService::instance(lockDialogModel)->setCurUserName(lockDialogModel->defaultUserName());
- QString id = QString("ukui-screensaver-dialog"+QLatin1String(getenv("DISPLAY")));
+ QString strDisplay = "";
+ if (QString(qgetenv("XDG_SESSION_TYPE")) == "wayland") {
+ strDisplay = QLatin1String(getenv("WAYLAND_DISPLAY"));
+ } else {
+ strDisplay = QLatin1String(getenv("DISPLAY"));
+ }
+ QString id = QString("ukui-screensaver-dialog"+strDisplay);
QtSingleApplication app(id, argc, argv);
if (app.isRunning()) {
QString strArguments = QApplication::arguments().join(",");
diff --git a/src/widgets/fullbackgroundwidget.cpp b/src/widgets/fullbackgroundwidget.cpp
index 01d63d1..7cfee1e 100644
--- a/src/widgets/fullbackgroundwidget.cpp
+++ b/src/widgets/fullbackgroundwidget.cpp
@@ -47,6 +47,8 @@
#include "screensaverwidget.h"
#include "displayservice.h"
#include "configuration.h"
+#include <windowmanager/windowmanager.h>
+using namespace kdk;
FullBackgroundWidget::FullBackgroundWidget(LockDialogModel *model, QWidget *parent)
: QWidget(parent), m_modelLockDialog(model)
@@ -131,7 +133,9 @@ void FullBackgroundWidget::initUI()
}
setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
- KWindowSystem::setType(this->winId(), NET::ScreenLock);
+ QTimer::singleShot(100, this, [=]() {
+ WindowManager::setWindowLayer(this->windowHandle(), WindowLayer::ScreenLock);
+ });
// 登录模式下监听屏幕插拔
if (isGreeterMode()) {
@@ -458,6 +462,7 @@ void FullBackgroundWidget::onCloseScreensaver()
Q_EMIT m_modelLockDialog->lockStateChanged(false);
stopDelayLockScreen();
screenStatus = UNDEFINED;
+ m_isBlank = false;
}
void FullBackgroundWidget::onDesktopResized()
@@ -631,8 +636,8 @@ void FullBackgroundWidget::showEvent(QShowEvent *event)
{
if (QX11Info::isPlatformX11())
tryGrabKeyboard();
- QTimer::singleShot(10, this, [=]() {
- KWindowSystem::setType(this->winId(), NET::ScreenLock);
+ QTimer::singleShot(100, this, [=]() {
+ WindowManager::setWindowLayer(this->windowHandle(), WindowLayer::ScreenLock);
m_lockWidget->updateFont();
m_lockWidget->updateFontSize();
});

View File

@ -30,3 +30,4 @@
0030-82-fixbug.patch
0031-83-fixbug.patch
0032-84-fixbug.patch
0033-85-fixbug.patch