Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify window size rounding strategy #2297

Merged
merged 4 commits into from
Dec 1, 2022
Merged

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Dec 1, 2022

There has been some divergence in the rounding strategy of window sizes. This PR unifies the strategy on Windows and GTK.
(On macOS the OS controls it. I didn't look at X11/Wayland in much depth.)

Before this PR some places used ScaledArea::from_dp (Size::expand under the hood) and others used f64::round. Now all the window size scaling is done via ScaledArea::from_dp. A unified strategy will help cut down on obscure bugs. This will also allow for easier strategy changes in the future if there is a need, as we can just change that one method.

This PR also contains:

  • A fix for get_size not being in display points on Windows (backport of glazier#35)
  • An implementation of get_scale on macOS (backport of glazier#36)
  • A few comment types converted from dobule- to triple-slash

@xStrom xStrom added shell/mac concerns the macOS backend shell/win concerns the Windows backend shell/gtk concerns the GTK backend S-needs-review waits for review labels Dec 1, 2022
@jneem jneem added port-to-glazier and removed S-needs-review waits for review labels Dec 1, 2022
@xStrom xStrom merged commit 52d5529 into linebender:master Dec 1, 2022
@xStrom xStrom deleted the dpi-fixes branch December 1, 2022 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-to-glazier shell/gtk concerns the GTK backend shell/mac concerns the macOS backend shell/win concerns the Windows backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants