Repository navigation
Conversation
TheKas
force-pushed
the
feat/dpi-slider-stops
branch
from
October 27, 2026 01:25
623c310 to
599448d
Compare
TheKas
pushed a commit
to TheKas/OpenLogi
that referenced
this pull request
Nov 6, 2026
AprilNEA#1059 at 0d0929d, ported onto master's SliderRow layout so AprilNEA#2065 can build on it. Co-authored-by: David Budnick <david@budnick.ca> Co-authored-by: AprilNEA <github@sku.moe>
TheKas
force-pushed
the
feat/dpi-slider-stops
branch
from
November 6, 2026 08:44
599448d to
81e7b77
Compare
TheKas
pushed a commit
to TheKas/OpenLogi
that referenced
this pull request
Nov 10, 2026
AprilNEA#1059 at 0d0929d, ported onto master's SliderRow layout so AprilNEA#2065 can build on it. Co-authored-by: David Budnick <david@budnick.ca> Co-authored-by: AprilNEA <github@sku.moe>
TheKas
force-pushed
the
feat/dpi-slider-stops
branch
from
November 10, 2026 23:52
81e7b77 to
7eedd5e
Compare
AprilNEA#1059 at 0d0929d, ported onto master's SliderRow layout so AprilNEA#2065 can build on it. Co-authored-by: David Budnick <david@budnick.ca> Co-authored-by: AprilNEA <github@sku.moe>
The preset chips now show in ascending order. Only the display is sorted: the stored list is the DPI-button cycle order and stays as the user built it, and removing a chip still addresses its stored position.
A gaming sensor such as the PRO X3 SUPERSTRIKE reports 977 values from 100 to 48000 in steps down to 1, so the slider moved tens of DPI per pixel and squeezed the usual range into its left end. The slider now stops at the supported values on the 50-DPI grid between 200 and 8000, the list an office mouse like the MX Master 4 reports and keeps as is. The field beside it still takes any value the device supports, and a list with fewer than two values on the grid is offered whole.
A mouse without a saved preset list showed no presets, and its DPI button cycled nothing. Config::dpi_presets now offers 800 and 1000 while the device never set a list, for the GUI and the agent's DPI cycle alike. The defaults are not written to config.toml; a list the user empties is saved as `dpi_presets = []` and stays empty.
Beside a slider that ends at 8000, the PRO X3's whole list read as "100-48000 · step 1", as if the slider still covered it. The label now shows the slider's stops: 200-8000 in steps of 50.
TheKas
force-pushed
the
feat/dpi-slider-stops
branch
2 times, most recently
from
November 21, 2026 08:59
38b424e to
c551e6d
Compare
The agent fell back to a gaming layout's stock levels when a mouse had no presets, but the GUI did not, and the new 800/1000 defaults would have replaced them. Config::dpi_presets now decides the default for both: the user's list, else the layout's stock levels, else 800/1000.
TheKas
force-pushed
the
feat/dpi-slider-stops
branch
from
November 22, 2026 10:43
c551e6d to
4944141
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Split out of #1724 as requested there. Builds on #1059 (the numeric DPI field): the slider here stops at 8000, and values above it stay reachable only through that field. Review only the commits after the first. The first commit is #1059 at
0d0929da, ported onto master'sSliderRowlayout (the field sits beside the slider in the row's control slot), with its authors kept. Once #1059 is merged, that commit drops out. Draft until then.496ff2ee). Preset chips are listed smallest first. Only the display is sorted, so the DPI-button cycle order stays as the user built it, and removing a chip still addresses it by its stored position.fdfafb7a). A gaming sensor such as the PRO X3 SUPERSTRIKE reports 977 values from 100 to 48000, in steps down to 1. The slider then moves tens of DPI per pixel and squeezes the usual range into its left end. It now stops at the supported values on the 50-DPI grid between 200 and 8000, which is the list an office mouse like the MX Master 4 reports and keeps as is. A list with fewer than two values on that grid is offered whole.806a50e4). A mouse that never saved a preset list offers 800 and 1000, so its DPI button cycles from the start.e2f04f9f). The label under the slider shows the slider's range ("200–8000 · step 50") instead of the device's whole list, which read as if the slider still covered 100–48000.81e7b774). Since feat: add G502 LIGHTSPEED support (by @RisenID) #1729 the agent cycles a gaming layout's stock DPI levels while a mouse has no presets; the GUI showed none, and the 800/1000 defaults would have replaced them.Config::dpi_presetsnow makes that call for both: the user's list, else the layout's stock levels, else 800/1000.Changes
DpiCapabilities::slider_stops(): the supported values on the 50-DPI grid from 200 to 8000, or the whole list when fewer than two fall on it.DeviceConfig::dpi_presetsbecomesOption<Vec<Dpi>>.None(never set) offers the gaming layout's stock levels, elseDEFAULT_DPI_PRESETS(800, 1000), throughConfig::dpi_presets(device_key, model_key), the one place the GUI and the agent's DPI cycle read. The defaults are never written. An emptied list is saved asdpi_presets = []and stays empty. The identity fold keeps the canonical side's list, an emptied one included.slider_stops(). A drag snaps to the nearest stop before the device's list resolves it, so it never lands on a value the slider doesn't offer. feat(gui): pair the DPI slider with an editable numeric field #1059's field still uses the device's whole list.AppState::dpi_presetsreads the device's config key, the same key the agent's cycle uses, so both see the defaults alike.Rebase onto
9ca7ef0Rebased onto
9ca7ef0. The tray menu (new on master) now passes the model key todpi_presets, the same way the agent's DPI cycle does, so the menu offers a gaming mouse's stock levels. The tray test for a mouse without presets now covers an emptied list, because an unconfigured mouse gets 800/1000 now.Testing
Rebased onto master
9ca7ef0c, on the final tip4944141b(Linux, Rust 1.99):cargo xtask ciwith fmt,clippy --workspace --all-targets -D warnings,cargo test --workspace, rustdoc, MSRV, wasm. CI's clippy on Rust 1.100 also fails on unchanged master code (map_unwrap_or); that is fixed separately upstream. Locally, clippy 1.100 reports nothing in lines this PR touches; the last hit, inAppState::dpi_presets, now usesmap_or_default.Not run locally: typos,
ast-grep,cargo deny, macOS/Windows tests and macOS clippy. Theclippy (windows)proxy fails on this host before linting:openlogi-flow(quinn/rustls) now pullsringintoopenlogi-agent-core, andringneeds a mingw C toolchain. The same happens on master. Windows clippy on the ring-free crates (core, hidpp, hid, hook, inject, camera) is clean;openlogi-agentandopenlogi-agent-coreare left to CI.New tests:
[]; the never-set lookup returns the defaults.Tested on real hardware (Linux, PRO X3 SUPERSTRIKE via
c54f, MX Master 4 over Bluetooth), on the same changes before the split: the X3's slider spans 200–8000 and its label reads "200–8000 · step 50". By construction it moves in steps of 100 between 2000 and 5000, because the sensor takes only steps of 20 there; that and a value above 8000 typed into #1059's field weren't checked separately. Not re-tested on hardware on top of #1059's0d0929da.Not runtime-tested on macOS or Windows.
Notes