bemenu icon indicating copy to clipboard operation
bemenu copied to clipboard

wayland: dpi-aware

Open dkwo opened this issue 2 years ago • 7 comments

Is it possible to make bemenu DPI-aware on Wayland? This is the behavior e.g. of the foot terminal emulator: if I set font to size 12, it will take into account the DPI as advertised by the compositor, and act accordingly. (I know there's the scaling option, but it seems suboptimal.)

Thanks.

dkwo avatar Mar 11 '22 16:03 dkwo

Wayland backend should already be aware of output's scale

Cloudef avatar Mar 12 '22 06:03 Cloudef

I agree it is aware of scale, but that's not what I'm discussing; I'm suggesting it could be aware of the output's DPI, which is different. The compositor has that information, and there should be a way to pick it and pass it to fontconfig/pango.

dkwo avatar Mar 12 '22 18:03 dkwo

Is there protocol that exposes DPI on wayland?

Cloudef avatar Mar 13 '22 00:03 Cloudef

Not directly.

One can use wl_output::geometry and wl_output::mode to compute DPI, as done e.g. here: https://codeberg.org/dnkl/foot/src/branch/master/wayland.c#L1294

dkwo avatar Mar 13 '22 16:03 dkwo

closing this, as maybe asking too much

dkwo avatar Nov 02 '23 18:11 dkwo

Better keep it open as it's still open issue right?

Cloudef avatar Nov 03 '23 03:11 Cloudef

sure, if one wants the same (optimal) behavior as foot :) I think, a more important issue to be fixed is the one with scaling: currently, if I use wlr-randr --output ${ext} --scale 2, then bemenu font looks blurry. @Cloudef what do you think?

dkwo avatar Nov 03 '23 16:11 dkwo