Commit 63a3466
Detach disabled devices after surface.Load (v4.1.33)
The pre-Load skip-attach in LoadDeviceProvider was moot: surface.Load
calls provider.Initialize() which populates provider.Devices, then
attaches every device in that collection to the surface
unconditionally. The manual loop above iterates against an empty
provider.Devices for async providers (Hue / LIFX) and is overridden
by Load even when it isn't.
Add a post-Load pass that walks provider.Devices, checks
MappingLayers.IsDeviceDisabled, and detaches the disabled ones from
the surface. _activeDevices is updated to false in the same pass so
the rest of the codebase (effect dispatch, brightness writes) sees a
consistent disabled state.
Symptom: a device disabled in the Mappings tab persisted the disable
state across restarts (v4.1.30 fix worked there), but layers and
effects continued to render to the hardware after the restart because
surface.Load had silently re-attached the device. This commit closes
that loop.
Build clean, 130/130 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8d8f982 commit 63a3466
5 files changed
Lines changed: 28 additions & 7 deletions
File tree
- Chromatics
- Core
- obj
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
747 | 770 | | |
748 | 771 | | |
749 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3697 | 3697 | | |
3698 | 3698 | | |
3699 | 3699 | | |
3700 | | - | |
| 3700 | + | |
3701 | 3701 | | |
3702 | 3702 | | |
3703 | 3703 | | |
| |||
0 commit comments