vlang / ui

A cross-platform UI library written in V
MIT License
2.33k stars 153 forks source link

Windows spanning across multiple screens each having different DPI and size #19

Open dumblob opened 4 years ago

dumblob commented 4 years ago

(copy of https://gist.github.com/vurtun/61b6dbf21ef060bcbbd8d1faa88350d9#gistcomment-2223201 )

Path to full DPI and screen size independency

I'd like V UI to support the following case (which is very common and won't disappear because of huge overlap of lifetimes of screens). Native GUI libs usually don't support it at all, but let's hope there are some workarounds.

Let's assume I have 3 different physical LCD displays and want to use a V UI application on all of them simultaneously (one application window spanning across all three displays). The LCDs are physically placed like this:

final_physical_displays_positioning (note the bezels which make the physical displaying surface non-continuous)

This is how the physical surface itself looks like: final_physical_displays_positioning_without_bezels

Graphic cards nowadays support more displays using a "virtual" huge "multibuffer canvas" where all the 3 different "framebuffers", each corresponding to one and only one LCD, must fit in. But because each LCD has not only different physical dimensions, they have also different resolutions and therefore the "multibuffer canvas" (yellow color) used by graphic cards to draw the actual pixels to looks like this:

multibuffer_canvas_after_applying_physical_dpi_of_lcds

The issue is, that all UIs known to me do not have the capability to support different resolutions in different areas of the "multibuffer canvas" and thus they just choose some "random" DPI (usually the DPI of the first physical display in the list of physical displays connected to the running system, which is of course unpredictable) with the following result:

multibuffer_canvas_after_applying_physical_dpi_of_lcds-bad_gui_toolkit

Which looks on the whole physical surface like this:

final_physical_displays_positioning_without_bezels-bad_gui_toolkit

medvednikov commented 4 years ago

Yes, this is very important to implement.

krolaw commented 4 years ago

Probably related - the examples look really small on my 4k 13" laptop screen (Ubuntu 19.10).