From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 083CC13835A for ; Tue, 23 Jun 2020 15:29:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F4C6E0886; Tue, 23 Jun 2020 15:29:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ACBBFE0886 for ; Tue, 23 Jun 2020 15:29:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6978534F207 for ; Tue, 23 Jun 2020 15:29:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5523921D for ; Tue, 23 Jun 2020 15:29:54 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1592926182.b652780039e7ae6fef23c60bccb0a2d5064e8ca4.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: kde-plasma/powerdevil/files/, kde-plasma/powerdevil/ X-VCS-Repository: repo/gentoo X-VCS-Files: kde-plasma/powerdevil/files/powerdevil-5.18.5-fix-powermgmt-inhibition.patch kde-plasma/powerdevil/powerdevil-5.18.5-r1.ebuild X-VCS-Directories: kde-plasma/powerdevil/ kde-plasma/powerdevil/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: b652780039e7ae6fef23c60bccb0a2d5064e8ca4 X-VCS-Branch: master Date: Tue, 23 Jun 2020 15:29:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 898a17d2-0a2f-4ed7-b8a8-c07760f9376d X-Archives-Hash: 55f404c40620c6393260a23f84e5a313 commit: b652780039e7ae6fef23c60bccb0a2d5064e8ca4 Author: Andreas Sturmlechner gentoo org> AuthorDate: Tue Jun 23 15:25:23 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Tue Jun 23 15:29:42 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6527800 kde-plasma/powerdevil: Fix random inhibition issues KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=423131 Package-Manager: Portage-2.3.102, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner gentoo.org> ...owerdevil-5.18.5-fix-powermgmt-inhibition.patch | 80 ++++++++++++++++++++++ kde-plasma/powerdevil/powerdevil-5.18.5-r1.ebuild | 69 +++++++++++++++++++ 2 files changed, 149 insertions(+) diff --git a/kde-plasma/powerdevil/files/powerdevil-5.18.5-fix-powermgmt-inhibition.patch b/kde-plasma/powerdevil/files/powerdevil-5.18.5-fix-powermgmt-inhibition.patch new file mode 100644 index 00000000000..cb6e27b7a97 --- /dev/null +++ b/kde-plasma/powerdevil/files/powerdevil-5.18.5-fix-powermgmt-inhibition.patch @@ -0,0 +1,80 @@ +From d21102cc6c7a4db204a29f376ce5eb316ef57a6e Mon Sep 17 00:00:00 2001 +From: Kai Uwe Broulik +Date: Fri, 19 Jun 2020 19:51:06 +0200 +Subject: [PATCH] Watch DBus service right away to discard pending inhibitions + reliably + +PowerDevil delays applying a power management inhibition by 5 seconds to avoid brief inhibitions +to e.g. wake up the screen and similar. +However, when an inhibition was posted and the process then quit, we would then still +enforce the inhibition as it wasn't explicitly revoked. +Fix this by always watching the inhibition sender and remove it from pending when the +service goes away. + +BUG: 423131 +FIXED-IN: 5.18.6 +--- + daemon/powerdevilpolicyagent.cpp | 26 ++++++++++++-------------- + 1 file changed, 12 insertions(+), 14 deletions(-) + +diff --git a/daemon/powerdevilpolicyagent.cpp b/daemon/powerdevilpolicyagent.cpp +index a7d92dfd..2c2b1152 100644 +--- a/daemon/powerdevilpolicyagent.cpp ++++ b/daemon/powerdevilpolicyagent.cpp +@@ -513,6 +513,11 @@ uint PolicyAgent::addInhibitionWithExplicitDBusService(uint types, const QString + + const int cookie = m_lastCookie; // when the Timer below fires, m_lastCookie might be different already + ++ if (!m_busWatcher.isNull() && !service.isEmpty()) { ++ m_cookieToBusService.insert(cookie, service); ++ m_busWatcher.data()->addWatchedService(service); ++ } ++ + m_pendingInhibitions.append(cookie); + + qCDebug(POWERDEVIL) << "Scheduling inhibition from" << service << appName << "with cookie" +@@ -532,11 +537,6 @@ uint PolicyAgent::addInhibitionWithExplicitDBusService(uint types, const QString + + m_cookieToAppName.insert(cookie, qMakePair(appName, reason)); + +- if (!m_busWatcher.isNull() && !service.isEmpty()) { +- m_cookieToBusService.insert(cookie, service); +- m_busWatcher.data()->addWatchedService(service); +- } +- + addInhibitionTypeHelper(cookie, static_cast< PolicyAgent::RequiredPolicies >(types)); + + Q_EMIT InhibitionsChanged({ {qMakePair(appName, reason)} }, {}); +@@ -596,22 +596,20 @@ void PolicyAgent::ReleaseInhibition(uint cookie) + { + qCDebug(POWERDEVIL) << "Releasing inhibition with cookie " << cookie; + +- if (m_pendingInhibitions.contains(cookie)) { ++ QString service = m_cookieToBusService.take(cookie); ++ if (!m_busWatcher.isNull() && !service.isEmpty() && !m_cookieToBusService.key(service)) { ++ // no cookies from service left ++ m_busWatcher.data()->removeWatchedService(service); ++ } ++ ++ if (m_pendingInhibitions.removeOne(cookie)) { + qCDebug(POWERDEVIL) << "It was only scheduled for inhibition but not enforced yet, just discarding it"; +- m_pendingInhibitions.removeOne(cookie); + return; + } + + Q_EMIT InhibitionsChanged(QList(), { {m_cookieToAppName.value(cookie).first} }); + m_cookieToAppName.remove(cookie); + +- +- QString service = m_cookieToBusService.take(cookie); +- if (!m_busWatcher.isNull() && !service.isEmpty() && !m_cookieToBusService.key(service)) { +- // no cookies from service left +- m_busWatcher.data()->removeWatchedService(service); +- } +- + // Look through all of the inhibition types + bool notify = false; + if (m_typesToCookie[ChangeProfile].contains(cookie)) { +-- +GitLab + diff --git a/kde-plasma/powerdevil/powerdevil-5.18.5-r1.ebuild b/kde-plasma/powerdevil/powerdevil-5.18.5-r1.ebuild new file mode 100644 index 00000000000..79f0394f5fe --- /dev/null +++ b/kde-plasma/powerdevil/powerdevil-5.18.5-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +ECM_HANDBOOK="forceoptional" +KFMIN=5.66.0 +PVCUT=$(ver_cut 1-3) +QTMIN=5.12.3 +inherit ecm kde.org + +DESCRIPTION="Power management for KDE Plasma Shell" +HOMEPAGE="https://invent.kde.org/plasma/powerdevil" + +LICENSE="GPL-2" # TODO: CHECK +SLOT="5" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +IUSE="brightness-control +wireless" + +DEPEND=" + >=kde-frameworks/kactivities-${KFMIN}:5 + >=kde-frameworks/kauth-${KFMIN}:5[policykit] + >=kde-frameworks/kcompletion-${KFMIN}:5 + >=kde-frameworks/kconfig-${KFMIN}:5 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/kcrash-${KFMIN}:5 + >=kde-frameworks/kdbusaddons-${KFMIN}:5 + >=kde-frameworks/kglobalaccel-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kidletime-${KFMIN}:5 + >=kde-frameworks/kio-${KFMIN}:5 + >=kde-frameworks/knotifications-${KFMIN}:5 + >=kde-frameworks/knotifyconfig-${KFMIN}:5 + >=kde-frameworks/kservice-${KFMIN}:5 + >=kde-frameworks/kwayland-${KFMIN}:5 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 + >=kde-frameworks/kxmlgui-${KFMIN}:5 + >=kde-frameworks/solid-${KFMIN}:5 + >=kde-plasma/libkscreen-${PVCUT}:5 + >=kde-plasma/libkworkspace-${PVCUT}:5 + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + >=dev-qt/qtx11extras-${QTMIN}:5 + virtual/libudev:= + x11-libs/libxcb + brightness-control? ( app-misc/ddcutil ) + wireless? ( + >=kde-frameworks/bluez-qt-${KFMIN}:5 + >=kde-frameworks/networkmanager-qt-${KFMIN}:5 + ) +" +RDEPEND="${DEPEND} + >=kde-plasma/kde-cli-tools-${PVCUT}:5 + >=sys-power/upower-0.9.23 +" + +PATCHES=( "${FILESDIR}/${P}-fix-powermgmt-inhibition.patch" ) # KDE-Bug 423131 + +src_configure() { + local mycmakeargs=( + -DHAVE_DDCUTIL=$(usex brightness-control) + $(cmake_use_find_package wireless KF5BluezQt) + $(cmake_use_find_package wireless KF5NetworkManagerQt) + ) + + ecm_src_configure +}