https://bugs.kde.org/show_bug.cgi?id=493844

Jakob Petsovits <jpe...@petsovits.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/powerdevil/-/commit/7e69
                   |                            |b58422bfb6fd99dbc422a00cbe8
                   |                            |7579b1116
         Resolution|---                         |FIXED

--- Comment #13 from Jakob Petsovits <jpe...@petsovits.com> ---
Git commit 7e69b58422bfb6fd99dbc422a00cbe87579b1116 by Jakob Petsovits.
Committed on 07/10/2024 at 22:51.
Pushed by jpetso into branch 'master'.

applets/brightness: Avoid producing duplicate display sliders

Sometimes a display configuration change results in more than one
change signal. These can happen in quick succession of each other.

The async code in ScreenBrightnessControl had a problem with this,
because it would sometimes interleave parts of its model update
function with another call of the same function. This would cause
duplicate brightness sliders to appear for the same display.

The solution is to make sure we don't try to update the model
while another update is already running.

One approach would be to simply take QCoro and async calls out
in favor of synchronous calls which are easier to reason about.
However, this would mean we block plasmashell for a longer time.

Instead, this commit introduces a call guard to the update function
which prevents another asynchronous call from entering its main body
of code while an existing update is already in the works.
After the update has finished, we will repeat the update process
in case another update request had been issued in the meantime.

M  +32   -19   applets/brightness/plugin/screenbrightnesscontrol.cpp
M  +3    -2    applets/brightness/plugin/screenbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/-/commit/7e69b58422bfb6fd99dbc422a00cbe87579b1116

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

Reply via email to