-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add ability to disable scaling #2457
base: master
Are you sure you want to change the base?
Conversation
Currently wayland displays can have some scalling applied (it is widely used with HiDPI displays). It is then handled via a `viewporter` or `fractional-scale` protocols. However it is sometimes desirable to explicitly disable scaling for some GLFW application to have a clear and perfect 1:1 pixel window content (ie. no scaling applied). This commit adds such a possiblity. To use it one can eg. set/export a variable like this: export GLFW_SCALE_TO_MONITOR=1 and then start the application.
With a9cc7c7 there is now the |
I'll try to test this ASAP... |
@elmindreda I built master branch of glfw and the above application with the above change included but unfortunately it is still ugly/upscaled, while with this PR it is working fine (without scaling). |
I think this is the issue. You seem to be referring to the scaling the compositor performs on the window, over which we have no control. The I think you want to set the hint to true. |
I tested with But this PR is doing something different, which I'd like to have. Disable UI scaling completely. Please take a look how it looks: https://skyboo.net/temp/glfw/SCALE_TO_MONITOR.png In fact this scaling is applied only when this env variable is set, so it doesn't affect any user, only those who are aware of this feature... so maybe you're willing to merge this? |
This PR essentially adds an option that switches the behaviors of If the changes in this PR makes your program draw correctly, then it is likely using the wrong one of these functions somewhere. |
@AlexandreRouma Setting the scale to 200% doesn't help to get the result as in my screenshot. |
SDR++ bases the scaling on glfwGetWindowSize() |
Currently wayland displays can have some scalling applied (it is widely used with HiDPI displays).
It is then handled via a
viewporter
orfractional-scale
protocols.However it is sometimes desirable to explicitly disable scaling for some GLFW application to have a clear and perfect 1:1 pixel window content (ie. no scaling applied).
This PR adds such a possiblity.
To use it one can eg. set/export a variable like this:
export GLFW_SCALE_TO_MONITOR=1
and then start the application.