feat(hyprland): offer the scales a monitor can actually take by SDcold · Pull Request #161 · pctrade/end4-pC · GitHub
Skip to content

feat(hyprland): offer the scales a monitor can actually take - #161

Open
SDcold wants to merge 2 commits into
pctrade:mainfrom
SDcold:feat/monitor-scale-valid-values
Open

SDcold wants to merge 2 commits into
pctrade:mainfrom
SDcold:feat/monitor-scale-valid-values

Conversation

@SDcold

@SDcold SDcold commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

The scale setting steps by 25%, so coming down from 100% the next stop is 75%. On a 1920x1080 laptop the one I actually wanted was 80%: it gives a 2400x1350 desktop, noticeably more room to work with, without going as small as 75%.

Lowering the step wouldn't have been enough on its own. Hyprland quantises the scale to 1/120 and then needs the logical size to land on whole pixels. Anything else it refuses, substitutes a "suggested scale" of its own and mentions it in its log. On 1920x1080 that means 80% and 83.33% are fine, while 90% doesn't exist at all, so a free 1% spin box would quietly hand back a different scale than the one you picked.

So rather than let people guess, the list is computed from the monitor's own resolution, and each entry shows the desktop size it produces. Everything offered is a value that will actually apply, and another monitor gets its own set, which is why the values are computed instead of hardcoded.

Screenshots

image

On this panel the list reads 75% · 2560×1440, 80% · 2400×1350, 83.33% · 2304×1296, 100% · 1920×1080, 120% · 1600×900, and so on up to 300%.

MonitorConfigOption gains two small helpers: validScales() builds the list for a resolution, and nearestValidScale() matches the float hyprctl reports back to an entry of that list, since ConfigComboBox compares values with === and would otherwise show nothing as selected.

A caveat worth knowing

A scale that isn't a whole number only comes out sharp in apps that implement wp_fractional_scale_v1. XWayland clients, GTK3 and some Electron builds get handed a whole scale instead, and the compositor resizes their buffers, so those windows look softer. Nothing the shell can do about it, it lives in the clients, but people shouldn't have to guess why one window went blurry: a notice now shows under the setting whenever a fractional scale is selected. Whole scales like 100% or 200% are unaffected.

Testing

Single 1920x1080 screen, Hyprland 0.56.2. I worked out the allowed divisors separately and got the same 17 values between 50% and 200% that the helper produces, so the list isn't guessing. The settings page reloads with no QML warnings, and the entry matching the current scale comes up selected.

Worth saying out loud since it isn't free: below 100% the clients draw a larger surface that the compositor scales down, so 80% means roughly 1.5x the pixels of 100%. Text stays sharp, but it does cost GPU time on an iGPU.

The scale setting was a spin box stepping by 25%, so the only values
reachable were 50, 75, 100, 125% and so on. On a 1920x1080 panel that
skips 80%, which is the one useful step down: it gives a 2400x1350
desktop, 56% more room, while staying a clean divisor.

Lower steps would not have been enough either. Hyprland quantises the
scale to 1/120 and then requires the logical size to land on whole
pixels; anything else is refused with "using suggested scale" in its
log, so a free 1% spin box would silently hand back a different scale
than the one asked for. 90% does not exist on 1920x1080 at all.

Compute the usable scales from the monitor's own resolution instead and
list them, each with the desktop size it produces, so every entry in the
list is one that will actually apply. The values differ per monitor,
which is why they are computed rather than hardcoded.

MonitorConfigOption gains validScales() for the list and
nearestValidScale() to match the float hyprctl reports back to an entry.
A scale that isn't a whole number only looks right in apps that
implement wp_fractional_scale_v1. XWayland clients, GTK3 and some
Electron builds are handed a whole scale instead and the compositor
resizes their buffers, which softens them.

That is a property of those clients, not something the shell can fix,
so say it where the choice is made rather than leaving people to
wonder why one window looks blurry. The notice only shows while a
fractional scale is selected.
@pctrade

pctrade commented Sep 21, 2026

Copy link
Copy Markdown
Owner

@SDcold

SDcold commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants