Fix revert-dpms-changes.patch

ubuntu/oracular
Aaron Rainbolt 5 months ago
parent 8b15c826fd
commit 8b201d80e3

1
debian/changelog vendored

@ -1,6 +1,7 @@
lxqt-powermanagement (2.0.0-0ubuntu1) UNRELEASED; urgency=medium lxqt-powermanagement (2.0.0-0ubuntu1) UNRELEASED; urgency=medium
* New upstream release. * New upstream release.
* Fix DPMS-related patch.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Wed, 26 Jun 2024 15:44:04 -0500 -- Aaron Rainbolt <arraybolt3@ubuntu.com> Wed, 26 Jun 2024 15:44:04 -0500

@ -7,80 +7,40 @@ Description: Remove DPMS-related and screensaver-suspending-related code
sets DPMS timeouts. This patch removes all of that code, fixing the crashes. sets DPMS timeouts. This patch removes all of that code, fixing the crashes.
Author: Aaron Rainbolt Author: Aaron Rainbolt
Origin: ubuntu Origin: ubuntu
Last-Update: 2023-11-14 Last-Update: 2024-06-26
--- ---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ 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) --- lxqt-powermanagement-2.0.0.orig/CMakeLists.txt
+++ lxqt-powermanagement-2.0.0/CMakeLists.txt
-set(LXQTBT_MINIMUM_VERSION "0.13.0") @@ -29,7 +29,6 @@ find_package(KF6IdleTime ${KF6_MINIMUM_V
set(KF5_MINIMUM_VERSION "5.101.0") find_package(KF6Solid ${KF6_MINIMUM_VERSION} REQUIRED)
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 ${LXQT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED) find_package(lxqt-globalkeys-ui ${LXQT_GLOBALKEYS_MINIMUM_VERSION} REQUIRED)
-find_package(XCB REQUIRED COMPONENTS xcb-dpms xcb-screensaver) -find_package(XCB REQUIRED COMPONENTS xcb-dpms xcb-screensaver)
message(STATUS "Building with Qt${Qt5Core_VERSION}") message(STATUS "Building with Qt${Qt6Core_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 <QGuiApplication> --- lxqt-powermanagement-2.0.0.orig/src/idlenesswatcher.cpp
+#include <QCoreApplication> +++ lxqt-powermanagement-2.0.0/src/idlenesswatcher.cpp
#include <QTimer> @@ -35,8 +35,6 @@
#include <KIdleTime>
#include <Solid/Device>
@@ -35,9 +35,6 @@
#include <QDebug> #include <QDebug>
#include <LXQt/lxqtnotification.h> #include <LXQt/lxqtnotification.h>
#include <QObject> #include <QObject>
-#include <QX11Info>
-#include <xcb/dpms.h> -#include <xcb/dpms.h>
-#include <xcb/screensaver.h> -#include <xcb/screensaver.h>
IdlenessWatcher::IdlenessWatcher(QObject* parent): IdlenessWatcher::IdlenessWatcher(QObject* parent):
Watcher(parent) Watcher(parent)
@@ -71,43 +68,14 @@ IdlenessWatcher::IdlenessWatcher(QObject* parent): @@ -70,47 +68,14 @@ IdlenessWatcher::IdlenessWatcher(QObject
connect(&mPSettings, &LXQt::Settings::settingsChanged, this, &IdlenessWatcher::onSettingsChanged); connect(&mPSettings, &LXQt::Settings::settingsChanged, this, &IdlenessWatcher::onSettingsChanged);
- // retrieve DPMS timeouts - // retrieve DPMS timeouts
- mDpmsStandby = mDpmsSuspend = mDpmsOff = 0; - mDpmsStandby = mDpmsSuspend = mDpmsOff = 0;
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) { - if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
- xcb_connection_t* c = QX11Info::connection(); - 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_cookie_t cookie = xcb_dpms_get_timeouts(c);
- xcb_dpms_get_timeouts_reply_t* reply = xcb_dpms_get_timeouts_reply(c, cookie, nullptr); - xcb_dpms_get_timeouts_reply_t* reply = xcb_dpms_get_timeouts_reply(c, cookie, nullptr);
- if (reply) { - if (reply) {
@ -90,6 +50,7 @@ index ecaa641..cb9d9e1 100644
- free(reply); - free(reply);
- } - }
- } - }
- }
- -
setup(); setup();
} }
@ -102,7 +63,8 @@ index ecaa641..cb9d9e1 100644
-void IdlenessWatcher::setDpmsTimeouts(bool restore) { -void IdlenessWatcher::setDpmsTimeouts(bool restore) {
- if (QGuiApplication::platformName() == QStringLiteral("xcb")) { - if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
- xcb_connection_t* c = QX11Info::connection(); - if (auto x11NativeInterface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>()) {
- xcb_connection_t* c = x11NativeInterface->connection();
- if (restore) { - if (restore) {
- xcb_dpms_set_timeouts(c, mDpmsStandby, mDpmsSuspend, mDpmsOff); - xcb_dpms_set_timeouts(c, mDpmsStandby, mDpmsSuspend, mDpmsOff);
- xcb_screensaver_suspend(c, 0); // WARNING: This is not documented but works. - xcb_screensaver_suspend(c, 0); // WARNING: This is not documented but works.
@ -113,11 +75,12 @@ index ecaa641..cb9d9e1 100644
- } - }
- } - }
- } - }
-}
- -
void IdlenessWatcher::setup() void IdlenessWatcher::setup()
{ {
if(mPSettings.isIdlenessWatcherEnabled()) { if(mPSettings.isIdlenessWatcherEnabled()) {
@@ -141,13 +109,6 @@ void IdlenessWatcher::setup() @@ -144,13 +109,6 @@ void IdlenessWatcher::setup()
milliseconds = 1000; milliseconds = 1000;
mIdleBacklightWatcher = KIdleTime::instance()->addIdleTimeout(milliseconds); mIdleBacklightWatcher = KIdleTime::instance()->addIdleTimeout(milliseconds);
} }
@ -131,10 +94,8 @@ index ecaa641..cb9d9e1 100644
} }
} }
diff --git a/src/idlenesswatcher.h b/src/idlenesswatcher.h --- lxqt-powermanagement-2.0.0.orig/src/idlenesswatcher.h
index dce9cc6..af0b585 100644 +++ lxqt-powermanagement-2.0.0/src/idlenesswatcher.h
--- a/src/idlenesswatcher.h
+++ b/src/idlenesswatcher.h
@@ -45,8 +45,6 @@ private Q_SLOTS: @@ -45,8 +45,6 @@ private Q_SLOTS:
void onSettingsChanged(); void onSettingsChanged();
@ -152,16 +113,3 @@ index dce9cc6..af0b585 100644
}; };
#endif // IDLENESSWATCHER_H #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;

Loading…
Cancel
Save