From 928e094586a2d17b5875fde9926112f720a63c19 Mon Sep 17 00:00:00 2001 From: Aaron Rainbolt Date: Tue, 14 Nov 2023 19:01:37 -0600 Subject: [PATCH 1/2] DPMS related code must go! --- debian/changelog | 6 + debian/patches/revert-dpms-changes.patch | 167 +++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 174 insertions(+) create mode 100644 debian/patches/revert-dpms-changes.patch diff --git a/debian/changelog b/debian/changelog index 8287292..6fa6a73 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +lxqt-powermanagement (1.4.0-0ubuntu2) noble; urgency=medium + + * Patched out DPMS-related code (it was causing constant crashes) + + -- Aaron Rainbolt Tue, 14 Nov 2023 19:00:33 -0600 + lxqt-powermanagement (1.4.0-0ubuntu1) noble; urgency=medium * New upstream release. diff --git a/debian/patches/revert-dpms-changes.patch b/debian/patches/revert-dpms-changes.patch new file mode 100644 index 0000000..3a4d6b3 --- /dev/null +++ b/debian/patches/revert-dpms-changes.patch @@ -0,0 +1,167 @@ +Description: Remove DPMS-related and screensaver-suspending-related code + lxqt-powermanagement added some code that allows the power manager to mess + with DPMS stuff. However it appears that DPMS is oftentimes not available in + Lubuntu, making lxqt-powermanagement crash over and over until it finally + gets disabled by LXQt until the next login. Some screensaver-related stuff + was also thrown in which seems unrelated but is in with a function that + sets DPMS timeouts. This patch removes all of that code, fixing the crashes. +Author: Aaron Rainbolt +Origin: ubuntu +Last-Update: 2023-11-14 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 07f9549..6215d9c 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.101.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) + 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 ecaa641..cb9d9e1 100644 +--- a/src/idlenesswatcher.cpp ++++ b/src/idlenesswatcher.cpp +@@ -24,7 +24,7 @@ + + #include "idlenesswatcher.h" + +-#include ++#include + #include + #include + #include +@@ -35,9 +35,6 @@ + #include + #include + #include +-#include +-#include +-#include + + IdlenessWatcher::IdlenessWatcher(QObject* parent): + Watcher(parent) +@@ -71,43 +68,14 @@ IdlenessWatcher::IdlenessWatcher(QObject* parent): + + 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); +- } +- } +- + setup(); + } + + IdlenessWatcher::~IdlenessWatcher() + { +- setDpmsTimeouts(true); + KIdleTime::instance()->removeAllIdleTimeouts(); + } + +-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); +- } +- } +-} +- + void IdlenessWatcher::setup() + { + if(mPSettings.isIdlenessWatcherEnabled()) { +@@ -141,13 +109,6 @@ void IdlenessWatcher::setup() + milliseconds = 1000; + mIdleBacklightWatcher = KIdleTime::instance()->addIdleTimeout(milliseconds); + } +- +- // override DPMS settings +- setDpmsTimeouts(false); +- } +- else { +- // restore DPMS settings +- setDpmsTimeouts(true); + } + } + +diff --git a/src/idlenesswatcher.h b/src/idlenesswatcher.h +index dce9cc6..af0b585 100644 +--- a/src/idlenesswatcher.h ++++ b/src/idlenesswatcher.h +@@ -45,8 +45,6 @@ private Q_SLOTS: + void onSettingsChanged(); + + private: +- void setDpmsTimeouts(bool restore); +- + PowerManagementSettings mPSettings; + int mIdleACWatcher; + int mIdleBatteryWatcher; +@@ -54,7 +52,6 @@ private: + LXQt::Backlight *mBacklight; + int mBacklightActualValue; + bool mDischarging; +- quint16 mDpmsStandby, mDpmsSuspend, mDpmsOff; + }; + + #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; diff --git a/debian/patches/series b/debian/patches/series index a4919f2..fd0ef1d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ battery-ux.patch +revert-dpms-changes.patch From 235a550c36cd2760166cf9baa81d3535b94a1eb1 Mon Sep 17 00:00:00 2001 From: Aaron Rainbolt Date: Tue, 14 Nov 2023 19:23:06 -0600 Subject: [PATCH 2/2] Repository-Browse, not Repository-Browser --- debian/changelog | 2 ++ debian/upstream/metadata | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6fa6a73..0b8da67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ lxqt-powermanagement (1.4.0-0ubuntu2) noble; urgency=medium * Patched out DPMS-related code (it was causing constant crashes) + * Renamed the "Repository-Browser" field to "Repository-Browse" in upstream + metadata. -- Aaron Rainbolt Tue, 14 Nov 2023 19:00:33 -0600 diff --git a/debian/upstream/metadata b/debian/upstream/metadata index 0194f40..15665fd 100644 --- a/debian/upstream/metadata +++ b/debian/upstream/metadata @@ -3,5 +3,4 @@ Bug-Database: https://github.com/lxqt/lxqt-powermanagement/issues Bug-Submit: https://github.com/lxqt/lxqt-powermanagement/issues/new Changelog: https://github.com/lxqt/lxqt-powermanagement/blob/master/CHANGELOG Repository: https://github.com/lxqt/lxqt-powermanagement -Repository-Browser: https://github.com/lxqt/lxqt-powermanagement - +Repository-Browse: https://github.com/lxqt/lxqt-powermanagement