Bug 438291 - multiple night color control applets block each other
Summary: multiple night color control applets block each other
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Brightness and Color (show other bugs)
Version: 6.0.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-08 21:08 UTC by Daniel
Modified: 2024-04-26 02:25 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1


Attachments
an video where multiple night color applets are used and they stop working. only after changing systemsettings, any applet works again. (600.85 KB, video/mp4)
2021-06-08 21:08 UTC, Daniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2021-06-08 21:08:05 UTC
Created attachment 139118 [details]
an video where multiple night color applets are used and they stop working. only after changing systemsettings, any applet works again.

SUMMARY
If you have multiple instances of the night color applet and you use one of them to turn night color on, and you click the other one, neither of them work any more and actually toggle night color. You have to turn off night color in systemsettings and back on to have the applet work again. This doesn't work consistently. See the video for an example

STEPS TO REPRODUCE
1. Have multiple applets for night color control
2. Use on to disable, on to enable it
3. See, it doesn't work and you have to toggle it in the systemsettings to make it work again

OBSERVED RESULT
The two applets seem to block each other and nothing is toggled. Even the nightcolor in the systemsettings need to be changed a few times to make any applet work again.

EXPECTED RESULT
Every night color applet should toggle the state and they shouldn't block each other.

Operating System: Arch Linux
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.9-arch1-1
OS Type: 64-bit
Graphics Platform: X11
Comment 1 Oliver Beard 2023-01-04 03:53:09 UTC
Multiple instances of the applet still seem to interact strangely, until only one applet is present (and the notification to undo removing other instances has been closed).
Comment 2 Natalie Clarius 2024-04-09 14:19:21 UTC
Yep, still behaving strangely in the newest version with Night Light integrated into the Brightness applet.
Comment 3 Natalie Clarius 2024-04-10 01:17:04 UTC
Looks like the problem is that the inhibitor backends don't pick up on other instances' inhibition state changed signal so don't get the current inhibition state updated.
Comment 4 Bug Janitor Service 2024-04-18 10:23:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4241
Comment 5 Natalie Clarius 2024-04-24 23:34:46 UTC
Git commit ba7cbbf04e2ffe88b0388d2a392513c6b382922f by Natalie Clarius.
Committed on 24/04/2024 at 23:22.
Pushed by nclarius into branch 'master'.

applets/brightness: fix night light inhibition state not synced across instances of the applet

Integrate inhibition properties into the monitor class so it becomes a night light control class, which also simplifies the back-of-the-frontend code.

Then use a static self member for the night light inhibitor from the control class, so that the inhibition state data (state, pending inhibits and cookie) can be shared among the applet instances.

Monitor the inhibited property to also pick up inhibitions created from outside the applet.

M  +28   -48   applets/brightness/package/contents/ui/NightLightItem.qml
M  +17   -36   applets/brightness/package/contents/ui/main.qml
M  +1    -1    applets/brightness/plugin/CMakeLists.txt
R  +87   -46   applets/brightness/plugin/nightlightcontrol.cpp [from: applets/brightness/plugin/nightlightmonitor.cpp - 060% similarity]
R  +28   -6    applets/brightness/plugin/nightlightcontrol.h [from: applets/brightness/plugin/nightlightmonitor.h - 082% similarity]
R  +10   -3    applets/brightness/plugin/nightlightcontrol_p.h [from: applets/brightness/plugin/nightlightmonitor_p.h - 081% similarity]
M  +36   -32   applets/brightness/plugin/nightlightinhibitor.cpp
M  +17   -18   applets/brightness/plugin/nightlightinhibitor.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/ba7cbbf04e2ffe88b0388d2a392513c6b382922f