From 6e95d1d23cb6b2068ac3cec0377235d18141f93d Mon Sep 17 00:00:00 2001 From: wiz <76851476+wizpizz@users.noreply.github.com> Date: Sat, 14 Nov 2026 19:02:53 +0100 Subject: [PATCH] fix(devices): lock DPI light brightness in modes that ignore it The VXE R1 Pro and R1 Pro Max take a DPI indicator brightness only while the effect is steady. The slider stayed enabled while breathing, so a change appeared to apply and then snapped back on the next read. Disable the slider when the driver's ui.dpiLighting.brightnessModes hint is present and does not include the current mode. Devices that do not send the hint behave as before. --- src/features/devices/cards/AdvancedCards.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/devices/cards/AdvancedCards.tsx b/src/features/devices/cards/AdvancedCards.tsx index afd85a6d..dc474ecb 100644 --- a/src/features/devices/cards/AdvancedCards.tsx +++ b/src/features/devices/cards/AdvancedCards.tsx @@ -649,6 +649,9 @@ export function DpiLightingCard({ snapshot }: { snapshot: ControlSnapshot }): Re const speedMax = hint?.speed.at(-1) ?? profile!.dpiLighting.speed.max; const locale = snapshot.preferences.locale; const lightMode = status.dpiLedMode ?? 0; + // Some mice only take a brightness in certain modes (ATK R1: steady only). + const brightnessModes: readonly number[] | undefined = hint?.brightnessModes; + const brightnessLocked = lightMode === 0 || (brightnessModes != null && !brightnessModes.includes(lightMode)); const staged = snapshot.pending.keys.some((key) => key.startsWith("teevolution-dpi-light-") || key === "dpi-light-sleep"); return ( @@ -684,7 +687,7 @@ export function DpiLightingCard({ snapshot }: { snapshot: ControlSnapshot }): Re max={brightnessMax} step={1} value={status.dpiLedBrightness ?? brightnessMin} - disabled={lightMode === 0 || status.dpiLedBrightness == null} + disabled={brightnessLocked || status.dpiLedBrightness == null} style={{ "--fill": `${((status.dpiLedBrightness ?? brightnessMin) - brightnessMin) / Math.max(1, brightnessMax - brightnessMin) * 100}%`,