Bug 495661 - Multiple Brightness and Color widgets do not stay in sync
Summary: Multiple Brightness and Color widgets do not stay in sync
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Brightness and Color (show other bugs)
Version: 6.2.2
Platform: NixOS Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-31 22:54 UTC by mk safavi
Modified: 2024-11-15 20:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mk safavi 2024-10-31 22:54:30 UTC
SUMMARY
On a dual monitor setup with two panels, the brightness and color widgets do not sync their values when one of them is adjusted. 

STEPS TO REPRODUCE
case one:
    1. Add two brightness and color widgets to the panel.
    2. Change the display brightness on one of the widgets.
    3. Open the other widget. It still shows the old brightness value.

case two:
    1. Add two brightness and color widgets to the panel.
    2. Open one of the widgets and pin it.
    3. Change the display brightness using the other widget.
    4. The pinned widget does not update to show the new brightness value.

OBSERVED RESULT
The brightness and color widgets do not update to reflect changes made in the other widget.

EXPECTED RESULT
Both brightness and color widgets should sync their values when one of them is adjusted, similar to how audio volume widget behaves.

SOFTWARE/OS VERSIONS
Operating System: NixOS 24.11
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.5 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-11-01 15:24:53 UTC
Can reproduce.
Comment 2 Bug Janitor Service 2024-11-15 05:02:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/462
Comment 3 Jakob Petsovits 2024-11-15 19:55:48 UTC
Git commit 5a06866f063b9c6577c89f6643236eeb0405afe5 by Jakob Petsovits.
Committed on 15/11/2024 at 19:53.
Pushed by jpetso into branch 'master'.

applets/brightness: Make brightness of multiple applets stay in sync

Previously, dragging the slider on one instance of the applet would
leave other instances untouched and thus out of sync. The sending
applet instance would include a hardcoded source client context
string in its `setBrightness` D-Bus method call, but *all* instances
would ignore the resulting brightness change event with this context.

To fix this, make sure that each applet instance uses a different
context string. We'll increment a number in each constructor and
use it as part of a context string template. Only the sending applet
instance will ignore brightness change events caused by its own
brightness setter call.

M  +6    -3    applets/brightness/plugin/screenbrightnesscontrol.cpp
M  +1    -0    applets/brightness/plugin/screenbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/-/commit/5a06866f063b9c6577c89f6643236eeb0405afe5
Comment 4 Jakob Petsovits 2024-11-15 20:08:05 UTC
Git commit 1197dc8a936b46578560f87764d98e37db0c6a4c by Jakob Petsovits.
Committed on 15/11/2024 at 20:03.
Pushed by jpetso into branch 'Plasma/6.2'.

applets/brightness: Make brightness of multiple applets stay in sync

Previously, dragging the slider on one instance of the applet would
leave other instances untouched and thus out of sync. The sending
applet instance would include a hardcoded source client context
string in its `setBrightness` D-Bus method call, but *all* instances
would ignore the resulting brightness change event with this context.

To fix this, make sure that each applet instance uses a different
context string. We'll increment a number in each constructor and
use it as part of a context string template. Only the sending applet
instance will ignore brightness change events caused by its own
brightness setter call.

(cherry picked from commit 5a06866f063b9c6577c89f6643236eeb0405afe5)

M  +6    -3    applets/brightness/plugin/screenbrightnesscontrol.cpp
M  +1    -0    applets/brightness/plugin/screenbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/-/commit/1197dc8a936b46578560f87764d98e37db0c6a4c