[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-09-01 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=394945

Nate Graham  changed:

   What|Removed |Added

   Version Fixed In|5.25|5.24.7

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-09-01 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=394945

Nate Graham  changed:

   What|Removed |Added

  Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
   |ma/powerdevil/commit/0f548c |ma/powerdevil/commit/35fb7f
   |53dd177235eaf5ce8452c9b4483 |501e6e0057d6fef8a0f9da425d5
   |9c12e21 |8dfd27a

--- Comment #12 from Nate Graham  ---
Git commit 35fb7f501e6e0057d6fef8a0f9da425d58dfd27a by Nate Graham, on behalf
of Louis Moureaux.
Committed on 01/09/2022 at 18:57.
Pushed by ngraham into branch 'Plasma/5.24'.

Fix profile switching in the brightness actions

The current code assumes that the action is notified of every profile change,
which is only the case when the action is configured to run in all profiles.
The code that prevents brightness from being raised when switching to a more
conservative profile gets confused if the action didn't run in the "previous"
profile. Make it more robust by always querying the core for the previous
profile, which it luckily hasn't updated yet when the action gets executed.
FIXED-IN: 5.25


(cherry picked from commit 6220db1b8a5038ed5e1359b1afdf70c0625f0895)

M  +8-7daemon/actions/bundled/brightnesscontrol.cpp
M  +0-1daemon/actions/bundled/brightnesscontrol.h
M  +9-7daemon/actions/bundled/keyboardbrightnesscontrol.cpp
M  +0-1daemon/actions/bundled/keyboardbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/commit/35fb7f501e6e0057d6fef8a0f9da425d58dfd27a

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-09-01 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=394945

Nate Graham  changed:

   What|Removed |Added

  Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
   |ma/powerdevil/commit/6220db |ma/powerdevil/commit/0f548c
   |1b8a5038ed5e1359b1afdf70c06 |53dd177235eaf5ce8452c9b4483
   |25f0895 |9c12e21

--- Comment #11 from Nate Graham  ---
Git commit 0f548c53dd177235eaf5ce8452c9b44839c12e21 by Nate Graham, on behalf
of Louis Moureaux.
Committed on 01/09/2022 at 18:55.
Pushed by ngraham into branch 'Plasma/5.25'.

Fix profile switching in the brightness actions

The current code assumes that the action is notified of every profile change,
which is only the case when the action is configured to run in all profiles.
The code that prevents brightness from being raised when switching to a more
conservative profile gets confused if the action didn't run in the "previous"
profile. Make it more robust by always querying the core for the previous
profile, which it luckily hasn't updated yet when the action gets executed.
FIXED-IN: 5.25


(cherry picked from commit 6220db1b8a5038ed5e1359b1afdf70c0625f0895)

M  +8-7daemon/actions/bundled/brightnesscontrol.cpp
M  +0-1daemon/actions/bundled/brightnesscontrol.h
M  +9-7daemon/actions/bundled/keyboardbrightnesscontrol.cpp
M  +0-1daemon/actions/bundled/keyboardbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/commit/0f548c53dd177235eaf5ce8452c9b44839c12e21

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-09-01 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=394945

David Edmundson  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Version Fixed In||5.25
 Status|ASSIGNED|RESOLVED
  Latest Commit||https://invent.kde.org/plas
   ||ma/powerdevil/commit/6220db
   ||1b8a5038ed5e1359b1afdf70c06
   ||25f0895

--- Comment #10 from David Edmundson  ---
Git commit 6220db1b8a5038ed5e1359b1afdf70c0625f0895 by David Edmundson, on
behalf of Louis Moureaux.
Committed on 01/09/2022 at 18:52.
Pushed by ngraham into branch 'master'.

Fix profile switching in the brightness actions

The current code assumes that the action is notified of every profile change,
which is only the case when the action is configured to run in all profiles.
The code that prevents brightness from being raised when switching to a more
conservative profile gets confused if the action didn't run in the "previous"
profile. Make it more robust by always querying the core for the previous
profile, which it luckily hasn't updated yet when the action gets executed.
FIXED-IN: 5.25

M  +8-7daemon/actions/bundled/brightnesscontrol.cpp
M  +0-1daemon/actions/bundled/brightnesscontrol.h
M  +9-7daemon/actions/bundled/keyboardbrightnesscontrol.cpp
M  +0-1daemon/actions/bundled/keyboardbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/commit/6220db1b8a5038ed5e1359b1afdf70c0625f0895

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-18 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=394945

--- Comment #9 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/plasma/powerdevil/-/merge_requests/90

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-18 Thread Bug Janitor Service
https://bugs.kde.org/show_bug.cgi?id=394945

Bug Janitor Service  changed:

   What|Removed |Added

 Status|CONFIRMED   |ASSIGNED

--- Comment #8 from Bug Janitor Service  ---
A possibly relevant merge request was started @
https://invent.kde.org/plasma/powerdevil/-/merge_requests/90

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-17 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=394945

--- Comment #7 from Nate Graham  ---
That makes sense! Since you've already done such great investigation and you're
clearly a talented developer, would you be interested in submitting a merge
request to fix it?

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-14 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=394945

--- Comment #6 from m_loui...@yahoo.com ---
Finally got a breakpoint set at the right place. Here is what I see:

Thread 1 "org_kde_powerde" hit Breakpoint 2,
PowerDevil::BundledActions::BrightnessControl::onProfileLoad
(this=0x55cba3ef1910) at ./daemon/actions/bundled/brightnesscontrol.cpp:80
80  in ./daemon/actions/bundled/brightnesscontrol.cpp
(gdb) print m_lastProfile
$9 = "LowBattery"
(gdb) print m_currentProfile
$10 = "LowBattery"

Even if I plug AC between two "LowBattery" events, m_lastProfile remains at
"LowBattery". This is because I unchecked "Screen Brightness" in the "AC" and
"Battery" tabs. When this is the case, the brightness control action doesn't
get notifications for profile changes and thus it doesn't update
m_currentProfile accordingly.

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-14 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=394945

--- Comment #5 from m_loui...@yahoo.com ---
I could reproduce it with powerdevil
4:5.24.4-0xneon+20.04+focal+release+build46. I used the following settings
(translating labels back from French):

* In the "Advanced" page:
* Weak level = 90%
* Critical level = 80%
* In the "Energy saving" page:
* Check "Screen brightness" and set the level to about 30% (which is the
default anyway)

Then I set the brightness to 10% and let the battery drain from its initial
93%. When it reached 90% the brightness went up to 30% as specified in the
configuration. I reproduced it again setting 85% as the weak level.

Note that there is no OSD notification of the new luminosity level, so you need
to set something visibly different or look in the applet.

I'll try to gdb in and understand what's going on at
https://invent.kde.org/plasma/powerdevil/-/blob/master/daemon/actions/bundled/brightnesscontrol.cpp#L84.
This code appears to be duplicated for keyboard brightness, so both will need a
fix.

-- 
You are receiving this mail because:
You are watching all bug changes.

[Powerdevil] [Bug 394945] Sometimes screen brightness gets raised at critical battery level if current brightness is lower than "low battery" profile's brightness

2022-05-14 Thread Nate Graham
https://bugs.kde.org/show_bug.cgi?id=394945

Nate Graham  changed:

   What|Removed |Added

Summary|screen brightness get's |Sometimes screen brightness
   |raised on critical battery  |gets raised at critical
   |level   |battery level if current
   ||brightness is lower than
   ||"low battery" profile's
   ||brightness

-- 
You are receiving this mail because:
You are watching all bug changes.