Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

WebView: Disable explicit content scaling in macOS #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevmeyer
Copy link

Currently, every website is wrongly scaled in macOS using a high dpi screen.
Before:
Screenshot 2022-09-23 at 19 50 20

After:
Screenshot 2022-09-23 at 19 52 14

Currently, every website is wrongly scaled in macOS
using a high dpi screen.
@linusg
Copy link
Contributor

linusg commented Sep 23, 2022

Not sure if this is broken more generally, this fix also improves things on my Linux laptop with a high DPI screen:

image

image

@elcuco
Copy link
Contributor

elcuco commented Sep 24, 2022

@linusg did you set m_inverse_pixel_scaling_ratio = 1 unconditionally on your laptop to get a "working scaling"? If so, this means that this whole concept is broken .

@linusg
Copy link
Contributor

linusg commented Sep 24, 2022

Yes, that's what I did.

@AtkinsSJ
Copy link
Contributor

I can't be certain, but I think I know what the core issue is: 1px in CSS is supposed to scale based on the device pixel size, but we don't support that yet. So, every px becomes one physical pixel. Spec: https://www.w3.org/TR/css-values-4/#reference-pixel

So the proper fix would be to implement that. Sounds like for now a good temporary fix would be to always set it to 1.0f, with a FIXME comment explaining that it should be 1.0 / devicePixelRatio() once LibWeb knows about HiDPI displays.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants