coppwr icon indicating copy to clipboard operation
coppwr copied to clipboard

Incorrect UI scaling

Open dromer opened this issue 2 years ago • 10 comments

At the moment the default size is rather huge, which makes the entire UI very difficult to view and navigate. For the graph we can zoom out, but the rest of the UI is still very bulky this way.

Please add an option to change the default font size, so we can adjust the way the entire UI gets sized.

dromer avatar Dec 24 '23 21:12 dromer

This may be a bug, can you provide a screenshot?

dimtpap avatar Dec 24 '23 21:12 dimtpap

Sure:

dromer avatar Dec 24 '23 22:12 dromer

I tried on latest Ubuntu X11 and got the same behavior. Linux Mint X11 though had no problems. What distro and window system are you running?

dimtpap avatar Dec 28 '23 07:12 dimtpap

Debian 12, X11 and Fluxbox.

Not having any fancy Hi-DPI going btw.

dromer avatar Dec 28 '23 08:12 dromer

The scaling is set based on Xft.dpi, maybe it's not set correctly in your setup. As a workaround you can run coppwr with the WINIT_X11_SCALE_FACTOR environment variable set to your display's scale factor, or whatever works best. For example WINIT_X11_SCALE_FACTOR=1 coppwr

dimtpap avatar Dec 28 '23 08:12 dimtpap

Indeed WINIT_X11_SCALE_FACTOR is not set. If I set it to 1 everything looks good!

So maybe default to 1 when the env-var is not used?

dromer avatar Dec 28 '23 08:12 dromer

It may be a bug in winit, the windowing library used by coppwr, that should be reported. I'll try messing with Xft.dpi to see if it's respected. If it is, it's an end-user X11 configuration issue, otherwise it's a bug in winit

dimtpap avatar Dec 28 '23 08:12 dimtpap

Hmm, I don't think expecting unused envvars to be set makes a lot of sense. This is actually the first time I hear about this one.

Can you check with the winit devs then? This is a bit out of my league (I'm just a poor user ;) ).

Maybe related? -> https://github.com/rust-windowing/winit/issues/2231

dromer avatar Dec 28 '23 09:12 dromer

Maybe related? -> rust-windowing/winit#2231

Yes, winit falls back to a manual calculation of the factor based on the display's properties if neither Xft.dpi nor the env var are set. Thanks for linking it

dimtpap avatar Dec 28 '23 09:12 dimtpap

I'll keep this open for tracking purposes and for others to find it since this seems to be a common issue.

Workaround

Set Xft.dpi manually

dimtpap avatar Oct 24 '25 16:10 dimtpap