Commit 59e94c2
fix: preserve client-side brightness on monitor refetch (v6.4.5)
Sliding a monitor's brightness occasionally snapped back because
get_monitors / fetch_all_state reads brightness from the monitor over
DDC, and DDC takes time to settle. A refetch triggered during that
window (popup re-show, visibilitychange, monitors-changed event) would
return a stale value and clobber the user's intended setting.
Make the client the source of truth for brightness/contrast: when
refetching, merge by uid and keep the existing brightness/contrast
values. Monitor list, names, hidden flag, and contrast capability still
come from the backend.
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>1 parent 22872cd commit 59e94c2
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
37 | 55 | | |
38 | | - | |
| 56 | + | |
39 | 57 | | |
40 | 58 | | |
41 | 59 | | |
42 | | - | |
| 60 | + | |
43 | 61 | | |
44 | 62 | | |
45 | 63 | | |
| |||
91 | 109 | | |
92 | 110 | | |
93 | 111 | | |
94 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
99 | 119 | | |
100 | | - | |
| 120 | + | |
101 | 121 | | |
102 | 122 | | |
103 | 123 | | |
| |||
0 commit comments