|
|
|
@ -7,87 +7,48 @@ Description: Remove DPMS-related and screensaver-suspending-related code
|
|
|
|
|
sets DPMS timeouts. This patch removes all of that code, fixing the crashes.
|
|
|
|
|
Author: Aaron Rainbolt
|
|
|
|
|
Origin: ubuntu
|
|
|
|
|
Last-Update: 2023-11-14
|
|
|
|
|
Last-Update: 2024-06-26
|
|
|
|
|
---
|
|
|
|
|
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
|
index 876ecc3..9585409 100644
|
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
|
+++ b/CMakeLists.txt
|
|
|
|
|
@@ -15,22 +15,18 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
|
|
|
|
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
|
|
|
|
|
|
|
|
|
|
-set(LXQTBT_MINIMUM_VERSION "0.13.0")
|
|
|
|
|
set(KF5_MINIMUM_VERSION "5.36.0")
|
|
|
|
|
set(LXQT_MINIMUM_VERSION "1.4.0")
|
|
|
|
|
set(QT_MINIMUM_VERSION "5.15.0")
|
|
|
|
|
|
|
|
|
|
-find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(Qt5DBus ${QT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(Qt5Svg ${QT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
-find_package(Qt5X11Extras ${QT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(KF5IdleTime ${KF5_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(KF5Solid ${KF5_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
--- lxqt-powermanagement-2.0.0.orig/CMakeLists.txt
|
|
|
|
|
+++ lxqt-powermanagement-2.0.0/CMakeLists.txt
|
|
|
|
|
@@ -29,7 +29,6 @@ find_package(KF6IdleTime ${KF6_MINIMUM_V
|
|
|
|
|
find_package(KF6Solid ${KF6_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(lxqt ${LXQT_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
|
|
|
|
|
-find_package(XCB REQUIRED COMPONENTS xcb-dpms xcb-screensaver)
|
|
|
|
|
|
|
|
|
|
message(STATUS "Building with Qt${Qt5Core_VERSION}")
|
|
|
|
|
|
|
|
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
|
|
|
index b29362a..177ddb1 100644
|
|
|
|
|
--- a/src/CMakeLists.txt
|
|
|
|
|
+++ b/src/CMakeLists.txt
|
|
|
|
|
@@ -57,8 +57,6 @@ target_link_libraries(lxqt-powermanagement
|
|
|
|
|
KF5::Solid
|
|
|
|
|
KF5::IdleTime
|
|
|
|
|
lxqt-globalkeys
|
|
|
|
|
- Qt5::X11Extras
|
|
|
|
|
- ${XCB_LIBRARIES}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
install(TARGETS
|
|
|
|
|
diff --git a/src/idlenesswatcher.cpp b/src/idlenesswatcher.cpp
|
|
|
|
|
index 615519e..5ff2ad1 100644
|
|
|
|
|
--- a/src/idlenesswatcher.cpp
|
|
|
|
|
+++ b/src/idlenesswatcher.cpp
|
|
|
|
|
@@ -24,7 +24,7 @@
|
|
|
|
|
|
|
|
|
|
#include "idlenesswatcher.h"
|
|
|
|
|
message(STATUS "Building with Qt${Qt6Core_VERSION}")
|
|
|
|
|
|
|
|
|
|
-#include <QGuiApplication>
|
|
|
|
|
+#include <QCoreApplication>
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <KIdleTime>
|
|
|
|
|
#include <Solid/Device>
|
|
|
|
|
@@ -34,9 +34,6 @@
|
|
|
|
|
--- lxqt-powermanagement-2.0.0.orig/src/idlenesswatcher.cpp
|
|
|
|
|
+++ lxqt-powermanagement-2.0.0/src/idlenesswatcher.cpp
|
|
|
|
|
@@ -35,8 +35,6 @@
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <LXQt/lxqtnotification.h>
|
|
|
|
|
#include <QObject>
|
|
|
|
|
-#include <QX11Info>
|
|
|
|
|
-#include <xcb/dpms.h>
|
|
|
|
|
-#include <xcb/screensaver.h>
|
|
|
|
|
|
|
|
|
|
IdlenessWatcher::IdlenessWatcher(QObject* parent):
|
|
|
|
|
Watcher(parent)
|
|
|
|
|
@@ -70,43 +67,14 @@ IdlenessWatcher::IdlenessWatcher(QObject* parent):
|
|
|
|
|
@@ -70,47 +68,14 @@ IdlenessWatcher::IdlenessWatcher(QObject
|
|
|
|
|
|
|
|
|
|
connect(&mPSettings, &LXQt::Settings::settingsChanged, this, &IdlenessWatcher::onSettingsChanged);
|
|
|
|
|
|
|
|
|
|
- // retrieve DPMS timeouts
|
|
|
|
|
- mDpmsStandby = mDpmsSuspend = mDpmsOff = 0;
|
|
|
|
|
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
|
|
|
|
|
- xcb_connection_t* c = QX11Info::connection();
|
|
|
|
|
- xcb_dpms_get_timeouts_cookie_t cookie = xcb_dpms_get_timeouts(c);
|
|
|
|
|
- xcb_dpms_get_timeouts_reply_t* reply = xcb_dpms_get_timeouts_reply(c, cookie, nullptr);
|
|
|
|
|
- if (reply) {
|
|
|
|
|
- mDpmsStandby = reply->standby_timeout;
|
|
|
|
|
- mDpmsSuspend = reply->suspend_timeout;
|
|
|
|
|
- mDpmsOff = reply->off_timeout;
|
|
|
|
|
- free(reply);
|
|
|
|
|
- if (auto x11NativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
|
|
|
|
|
- xcb_connection_t* c = x11NativeInterface->connection();
|
|
|
|
|
- xcb_dpms_get_timeouts_cookie_t cookie = xcb_dpms_get_timeouts(c);
|
|
|
|
|
- xcb_dpms_get_timeouts_reply_t* reply = xcb_dpms_get_timeouts_reply(c, cookie, nullptr);
|
|
|
|
|
- if (reply) {
|
|
|
|
|
- mDpmsStandby = reply->standby_timeout;
|
|
|
|
|
- mDpmsSuspend = reply->suspend_timeout;
|
|
|
|
|
- mDpmsOff = reply->off_timeout;
|
|
|
|
|
- free(reply);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
@ -102,14 +63,16 @@ index 615519e..5ff2ad1 100644
|
|
|
|
|
|
|
|
|
|
-void IdlenessWatcher::setDpmsTimeouts(bool restore) {
|
|
|
|
|
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
|
|
|
|
|
- xcb_connection_t* c = QX11Info::connection();
|
|
|
|
|
- if (restore) {
|
|
|
|
|
- xcb_dpms_set_timeouts(c, mDpmsStandby, mDpmsSuspend, mDpmsOff);
|
|
|
|
|
- xcb_screensaver_suspend(c, 0); // WARNING: This is not documented but works.
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- xcb_dpms_set_timeouts(c, 0, 0, 0);
|
|
|
|
|
- xcb_screensaver_suspend(c, XCB_SCREENSAVER_SUSPEND);
|
|
|
|
|
- if (auto x11NativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
|
|
|
|
|
- xcb_connection_t* c = x11NativeInterface->connection();
|
|
|
|
|
- if (restore) {
|
|
|
|
|
- xcb_dpms_set_timeouts(c, mDpmsStandby, mDpmsSuspend, mDpmsOff);
|
|
|
|
|
- xcb_screensaver_suspend(c, 0); // WARNING: This is not documented but works.
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- xcb_dpms_set_timeouts(c, 0, 0, 0);
|
|
|
|
|
- xcb_screensaver_suspend(c, XCB_SCREENSAVER_SUSPEND);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
@ -117,7 +80,7 @@ index 615519e..5ff2ad1 100644
|
|
|
|
|
void IdlenessWatcher::setup()
|
|
|
|
|
{
|
|
|
|
|
if(mPSettings.isIdlenessWatcherEnabled()) {
|
|
|
|
|
@@ -140,13 +108,6 @@ void IdlenessWatcher::setup()
|
|
|
|
|
@@ -144,13 +109,6 @@ void IdlenessWatcher::setup()
|
|
|
|
|
milliseconds = 1000;
|
|
|
|
|
mIdleBacklightWatcher = KIdleTime::instance()->addIdleTimeout(milliseconds);
|
|
|
|
|
}
|
|
|
|
@ -131,10 +94,8 @@ index 615519e..5ff2ad1 100644
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/idlenesswatcher.h b/src/idlenesswatcher.h
|
|
|
|
|
index dce9cc6..af0b585 100644
|
|
|
|
|
--- a/src/idlenesswatcher.h
|
|
|
|
|
+++ b/src/idlenesswatcher.h
|
|
|
|
|
--- lxqt-powermanagement-2.0.0.orig/src/idlenesswatcher.h
|
|
|
|
|
+++ lxqt-powermanagement-2.0.0/src/idlenesswatcher.h
|
|
|
|
|
@@ -45,8 +45,6 @@ private Q_SLOTS:
|
|
|
|
|
void onSettingsChanged();
|
|
|
|
|
|
|
|
|
@ -152,16 +113,3 @@ index dce9cc6..af0b585 100644
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // IDLENESSWATCHER_H
|
|
|
|
|
diff --git a/src/main.cpp b/src/main.cpp
|
|
|
|
|
index eedd360..493bf8b 100644
|
|
|
|
|
--- a/src/main.cpp
|
|
|
|
|
+++ b/src/main.cpp
|
|
|
|
|
@@ -34,7 +34,7 @@
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
- LXQt::Application a(argc, argv, true);
|
|
|
|
|
+ LXQt::Application a(argc, argv);
|
|
|
|
|
a.setQuitOnLastWindowClosed(false);
|
|
|
|
|
|
|
|
|
|
QCommandLineParser parser;
|
|
|
|
|