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

Blurred font with HiDPI #7

Open
etienne-w opened this issue Aug 17, 2023 · 1 comment
Open

Blurred font with HiDPI #7

etienne-w opened this issue Aug 17, 2023 · 1 comment

Comments

@etienne-w
Copy link

On a HiDPI screen with scale set to 2 in dwl the fonts are blurred in dwl-bar, I assume this is due to some up/downscaling in dwl-bar's code, as other surfaces render well. Any idea how to fix this?
Note that I am new to Wayland and there may be some setting I haven't seen. If you know how to fix and have some resources to explain what to do I'd be willing to patch it myself!

@MadcowOG
Copy link
Owner

MadcowOG commented Sep 6, 2023

I apologize for replying so late.

If you know how to fix and have some resources to explain what to do I'd be willing to patch it myself!

You can if you want, I have another version of the bar that I plan on making the "stable" version, eventually. I've just been a little busy and it still has some bugs, so I just don't really know when I will be finished with it.
If you still want to pursue adding scaling just make a pull request and I will merge it to main.

To get started take a look at the new branch as I believe it's doing scaling correctly (I would just test this to confirm, as I don't have a HiDPI monitor myself, if new doesn't scale correctly then let me know as all of this advice might be nil).
You will need to get the scale factor from the wl_output.scale event, then upon zwlr_layer_surface.configure you will need to multiply the width and height by the scale, and use these values for the buffer size and set the wl_surface scale with wl_surface.set_buffer_scale (you are probably going to want to do this every render). I don't know if you need to do anything special with cairo for rendering, you might be able to just leave the rest of the rendering code alone.

I assume this is due to some up/downscaling in dwl-bar's code

It's actually because we don't do any scaling at all, if we don't scale the image properly the compositor will do it for us, causing poor quality.

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

No branches or pull requests

2 participants