💾 Archived View for auragem.letz.dev › devlog › 20240412.gmi captured on 2024-07-09 at 02:07:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-10)

-=-=-=-=-=-=-

2024-04-12 Profectus Browser Alpha 0.3 Update

This is another small update to Profectus that contains very basic CSV/TSV/PSV file support, and more fixes to DPI/High DPI on macOS and Linux Wayland.

On Wayland and macOS, SDL gives the window size and mouse positions in points, and these points are based on the DPI scaling; a scale of 1.0 would just mean that 1 pixel equals 1 point, and so the window size matches the rendering pixel size. You can get this pixels-per-point scale by dividing the Renderer's Output size with the Window Size SDL has provided you. SDL will also give the mouse events' X and Y positions in *points* rather than pixels. Lastly, all of the SDL drawing functions want their rects and positions in *pixels* and not points!

If you chose not to change any of your rendering code and turn on the HIGHDPI setting, then the result is that everything will be rendered smaller in the top-left corner of the window on High DPI systems that use Wayland or macOS, because every UI element is being calculated and rendered in *points* rather than pixels. Interestingly, SDL seems to use the same size for the Window and the renderer's Output on X11 and Windows, so I just scale my UI elements based on the Display DPI instead.

There seems to be two ways to handle High DPI in SDL:

So, to simplify, I now do these two things:

I will be tweaking the size of elements in the next alpha update, as these changes have revealed that the default scaling of UI elements seems to be quite small. I will also be adding a way to manually increase or decrease the UI scale. There is also one more fix for DPI scaling that needs to be taken care of, and I hope to get that out in the next alpha as well.

Anyways, you can download the alpha via Gemini here:

Profectus Homepage

Precompiled Binaries Downloads

Profectus Gitlab Repository