Dynamically generate clean monitor scale presets for screen resolution
Summary
Currently, the monitor panel plugin (shell/plugins/panels/monitor/Panel.qml) uses a static array of scale presets:
readonly property var scalePresets: ["1", "1.25", "1.6", "2", "3", "4"]
Because Hyprland fractional scaling requires integer logical pixels (divisors of gcd(120 * W, 120 * H)) to prevent subpixel jitter and blur, static presets often:
- Do not match the exact clean divisors of common display resolutions.
- Offer values that are too high or impractical for 1080p/1440p displays (e.g. 3x and 4x on 1080p result in unworkable viewport heights) while missing useful clean fractional steps (e.g. 1.33x, 1.5x).
- Do not adapt to 1440p, Ultrawide, or 4K/Retina displays.
Proposed Solution
Dynamically compute clean scale presets tailored to the active monitor mode (W, H):
- Mathematical validity: Find scale candidates
s = k / 120where integerkdividesgcd(120 * W, 120 * H). - Resolution-tiered limits: Cap the upper scale limit based on vertical display height (
H <= 1080-> 2.0x;H <= 1600-> 2.5x;H > 1600-> 4.0x). - Uniform spacing: Pick up to 6 clean scale values anchored at 1.0x and the maximum clean scale, ensuring the monitor's current active scale is included and intermediate steps minimize spacing variance.
You already opened the implementation as #14986 — linking them here so review happens on the PR. Closing this issue in favour of that PR once it lands is fine.
2. You already opened the implementation as #14986 — linking them here so review happens on the PR. Closing this issue in favour of that PR once it lands is fine.
thanks for attention, but it already linked? or i don't understand something