term: only scale using DPI if *all* monitors have a scaling factor or one #720

Manually merged
dnkl merged 1 commits from non-dpi-aware-if-any-output-uses-scaling into master 1 month ago
dnkl commented 1 month ago
Owner

With dpi-aware=auto (the default), scale fonts using DPI only if all available monitors have a scaling factor of one.

The idea is this: if a user, with multiple monitors, have enabled scaling on at least one monitor, he/she has most likely done so to match the size of his/her other monitors.

For example, if the user has one monitor with a scaling factor of one, and another one with a scaling factor of two, he/she expects things to be twice as large on the second monitor.

If we (foot) scale using DPI on the first monitor, and using the scaling factor on the second monitor, foot will not look twice as big on the second monitor (this was the old behavior of dpi-aware=auto).

Closes #714

With `dpi-aware=auto` (the default), scale fonts using DPI **only if all** available monitors have a scaling factor of one. The idea is this: if a user, with multiple monitors, have enabled scaling on **at least** one monitor, he/she has most likely done so to match the size of his/her other monitors. For example, if the user has one monitor with a scaling factor of one, and another one with a scaling factor of two, he/she expects things to be twice as large on the second monitor. If we (foot) scale using DPI on the first monitor, and using the scaling factor on the second monitor, foot will **not** look twice as big on the second monitor (this was the old behavior of `dpi-aware=auto`). Closes #714
dnkl added the
bug
label 1 month ago
craigbarnes requested changes 1 month ago
terminal.c Outdated
}
}
UNREACHABLE();
Poster
Collaborator

Maybe this should be:

BUG("unhandled DPI awareness value");

...for the sake of DEBUG builds?

Maybe this should be: ```c BUG("unhandled DPI awareness value"); ``` ...for the sake of `DEBUG` builds?
dnkl commented 1 month ago
Poster
Owner

Fixed!

Fixed!
dnkl marked this conversation as resolved
craigbarnes requested changes 1 month ago
terminal.c Outdated
term_font_sized_by_scale(const struct terminal *term, int scale)
{
return !term_font_sized_by_dpi(term, scale);
case DPI_AWARE_AUTO: {
Poster
Collaborator

The enclosing braces seem unnecessary here.

The enclosing braces seem unnecessary here.
dnkl commented 1 month ago
Poster
Owner

Very much so :)

They've now been removed.

Very much so :) They've now been removed.
dnkl marked this conversation as resolved
dnkl changed title from WIP: term: only scale using DPI if *all* monitors have a scaling factor or one to term: only scale using DPI if *all* monitors have a scaling factor or one 1 month ago
dnkl force-pushed non-dpi-aware-if-any-output-uses-scaling from 6bbd06f7e8 to 765b15a621 1 month ago
dnkl force-pushed non-dpi-aware-if-any-output-uses-scaling from 765b15a621 to 3dbfd0ca70 1 month ago
dnkl force-pushed non-dpi-aware-if-any-output-uses-scaling from 3dbfd0ca70 to fb77637eb9 1 month ago
dnkl merged commit ebbac83236 into master manually 1 month ago

Reviewers

craigbarnes requested changes 1 month ago
The pull request has been manually merged as ebbac83236.
Sign in to join this conversation.
Loading…
There is no content yet.