feat: backport keyboard brightness restore patch

epel9^2
Marc Deop i Argemí 11 months ago
parent bfcf4fdb91
commit 7a960151f9
No known key found for this signature in database
GPG Key ID: 0BD48519688058E8

@ -0,0 +1,36 @@
From b30c584d6a724d350b7b8f6a30cc4bbbf9dbac3d Mon Sep 17 00:00:00 2001
From: Werner Sembach <wse@tuxedocomputers.com>
Date: Tue, 30 Jan 2024 14:26:53 +0100
Subject: [PATCH] kbd backlight: Fix double brightness restore on
LidOpen-resume
This fixes the issue that on LidOpen-resume the brightness might get restored
two times. Once to the correct vallue and once incorrectly to 0.
To archive this it uses the same simple "don't restore to 0"-policy as is used
in dimdisplay.cpp, dpms.cpp, and handlebuttonevent.cpp.
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
(cherry picked from commit aa2fa106)
---
daemon/actions/bundled/keyboardbrightnesscontrol.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/actions/bundled/keyboardbrightnesscontrol.cpp b/daemon/actions/bundled/keyboardbrightnesscontrol.cpp
index a7c5f6408..760e17ff5 100644
--- a/daemon/actions/bundled/keyboardbrightnesscontrol.cpp
+++ b/daemon/actions/bundled/keyboardbrightnesscontrol.cpp
@@ -75,7 +75,7 @@ KeyboardBrightnessControl::KeyboardBrightnessControl(QObject* parent, const QVar
// My laptop sets the keyboard brightness to zero when I close the lid and it suspends
// this makes sure the keyboard brightness is restored when we wake up :)
connect(backend(), &PowerDevil::BackendInterface::resumeFromSuspend, this, [this] {
- if (m_lastKeyboardBrightness > -1) {
+ if (m_lastKeyboardBrightness > 0) {
setKeyboardBrightnessSilent(m_lastKeyboardBrightness);
}
});
--
GitLab

@ -2,7 +2,7 @@
Name: powerdevil
Version: 5.27.10
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Manages the power consumption settings of a Plasma Shell
License: GPLv2+
@ -19,6 +19,9 @@ URL: https://invent.kde.org/plasma/%{name}
%endif
Source0: http://download.kde.org/%{stable}/plasma/%{plasma_version}/%{name}-%{version}.tar.xz
# Upstream patches
Patch0: fix_double_brightness_restore_on_lid_open.patch
# filter plugin provides
%global __provides_exclude_from ^(%{_kf5_qtplugindir}/.*\\.so)$
@ -130,6 +133,9 @@ rm -fv %{buildroot}/%{_libdir}/libpowerdevil{configcommonprivate,core,ui}.so
%{_kf5_qtplugindir}/powerdevil/action/powerdevil_*.so
%changelog
* Mon Feb 19 2024 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.27.10-2
- Backport keyboard backlit patch from upstream
* Sat Dec 16 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.27.10-1
- 5.27.10

Loading…
Cancel
Save