temp/gnome-settings-daemon: remove idle notification before suspend (MR 1937)

GNOME settings daemon notifies the user that the device will
suspend soon through a notification.
However, this triggers the notification LED which stays on during
suspend, causing unnecessary power consumption.
This commit is contained in:
Dylan Van Assche 2021-02-08 17:52:56 +01:00 committed by Bart Ribbers
parent 6fe006aa52
commit 6a8a62c327
No known key found for this signature in database
GPG key ID: 699D16185DAFAE61
3 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,27 @@
From 440754b27d506f4b2a15c9af6b8d47e21f2b1745 Mon Sep 17 00:00:00 2001
From: Dylan Van Assche <me@dylanvanassche.be>
Date: Mon, 8 Feb 2021 16:18:11 +0100
Subject: [PATCH] power-manager: close idleness notifications before suspending
Power-manager's idle notifications trigger the notification LED
on the PinePhone which causes additional power consumption.
---
plugins/power/gsd-power-manager.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c93c620f..95cec9c3 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2493,6 +2493,8 @@ on_randr_event (GnomeRRScreen *screen, gpointer user_data)
static void
handle_suspend_actions (GsdPowerManager *manager)
{
+ /* close any existing notification about idleness */
+ notify_close_if_showing (&manager->notification_sleep_warning);
backlight_disable (manager);
uninhibit_suspend (manager);
}
--
2.30.0

View file

@ -0,0 +1,41 @@
# Forked from Alpine to remove idle notification before suspend
pkgname=gnome-settings-daemon
pkgver=9999
_pkgver=3.38.1
pkgrel=0
pkgdesc="GNOME settings daemon"
url="https://gitlab.gnome.org/GNOME/gnome-settings-daemon"
arch="all !s390x !mips !mips64"
options="!check" # needs unpackaged py-dbusmock
license="GPL-2.0-only AND LGPL-2.1-only"
depends_dev="gnome-desktop-dev libnotify-dev
libcanberra-dev colord-dev geoclue-dev
libgweather-dev geocode-glib-dev
pulseaudio-dev upower-dev libwacom-dev
cups-dev networkmanager-dev polkit-dev
lcms2-dev nss-dev alsa-lib-dev gcr-dev
modemmanager-dev"
makedepends="$depends_dev libxml2-utils meson"
checkdepends="py3-gobject3"
depends="pulseaudio"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/gnome-settings-daemon-$_pkgver"
source="https://download.gnome.org/sources/gnome-settings-daemon/${_pkgver%.*}/gnome-settings-daemon-$_pkgver.tar.xz
0001-power-manager-close-idleness-notifications-before-su.patch
dont-use-logind-for-brightness-changing.patch"
build() {
abuild-meson \
-Dsystemd=false \
. output
meson compile ${JOBS:+-j ${JOBS}} -C output
}
package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
}
sha512sums="b32c0897d1a5680747bf68e9009ea44cf1a05ef807b772ca6514a278002754d520def7bced929b9004d3aec82a6e82b52637bd2eadd3f6cd54f3d0ac5c8e8cbd gnome-settings-daemon-3.38.1.tar.xz
8aef8a472e5c7aae58bb2d57bcac52921a3043a38f2f448cf6c2b450dae23ded1a147b2c7707d207058cdb4c9551ab78fd75a89661ed7e06ee0e87bb654c5379 0001-power-manager-close-idleness-notifications-before-su.patch
fd80b939a14bbc5dd502afda0bc6511f2d9c045018680e5ae7fbec32efadb564c5060ec91d374330f246d70571aad5979ce8c175175a29b5ccec3443c8286dc6 dont-use-logind-for-brightness-changing.patch"

View file

@ -0,0 +1,16 @@
Brightness control is currently broken with elogind, so fall back to
the previous codepath which doesn't use elogind.
See https://github.com/elogind/elogind/issues/158
diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c
index ca5f272..59048d9 100644
--- a/plugins/power/gsd-backlight.c
+++ b/plugins/power/gsd-backlight.c
@@ -482,7 +482,7 @@ gsd_backlight_set_brightness_val_async (GsdBacklight *backlight,
if (backlight->udev_device != NULL) {
BacklightHelperData *task_data;
- if (backlight->logind_proxy) {
+ if (0) {
g_dbus_proxy_call (backlight->logind_proxy,
"SetBrightness",
g_variant_new ("(ssu)",