commit
371523dd53
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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(",");
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue