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

Make media queries more robust #2850

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

daxpedda
Copy link
Member

@daxpedda daxpedda commented Jun 4, 2023

This improves on the original implementation: #1690.

  • Remove the use of MediaQueryListEvent, which isn't supported by Safari until v14. The callback parameter differs depending on browser support. Without MediaQueryListEvent support MediaQueryList is passed (spec). So we instead just clone the MediaQueryList into the closure.
  • Use accurate scale factors in the media query instead of approximating with min/max, which should avoid any further issues as discussed in Fixes rust-windowing/winit#2597 for good #2747 (comment).
  • Always initialize media queries. They should always work unless something is seriously wrong with our code.

Reverts #2599.
Replaces #2747 as discussed in #2747 (comment).

@daxpedda daxpedda merged commit 12fb37d into rust-windowing:master Jun 5, 2023
@daxpedda daxpedda mentioned this pull request Jun 11, 2023
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant