Aven on hiDPI screens

Olly Betts olly at survex.com
Thu Sep 9 05:07:30 BST 2021


On Thu, Sep 09, 2021 at 12:06:55AM +0100, Wookey wrote:
> On 2021-09-08 23:17 +0100, Olly Betts wrote:
> > This appears to make the OpenGL pane use the full space available when
> > tested with a normal display and GDK_SCALE=2, but I'm not confident that
> > setting GDK_SCALE would fully emulate the situation when OpenGL is in the
> > mix
> 
> Your patch does indeed correctly size the pane when GDK_SCALE=2 is
> set, so is a major impovement (because the text in the menus and
> survey tree and footer is twice as big and thus useable).

Oh, so is hidpi with a hidpi screen just done by setting GDK_SCALEi (for
GTK/GDK)?

In that case my concern that GDK_SCALE=2 on a standard screen might not
emulate a real hidpi screen is probably unfounded, as it's not an
emulation but just how hidpi works (on GTK/GDK anyway).  Unless anything
in the stack is making decisions based on the DPI value...

> > This patch probably also still leaves you with tiny text and indicators
> > inside the OpenGL, in which case those need scaling up to match.
> 
> You are correct: it does.
> 
> It also seems to be almost impossible to click on a station to select
> it, (I think that select-radius setting is changeable in the config
> file?)

Not in the config file, but you can press F2 to toggle "fat-finger mode"
which increases the radius to 5 times the default, which should help
for testing at least (this was added because someone complained it was
hard to use aven on a touch screen, but I never got any feedback on
whether it was a suitable change which is why it's only in as a
debug feature still).

Scaling the base radius here by GetContentScaleFactor() should work.

Or perhaps that radius should actually be set based on the DPI value (so
it'd end up about the same size on the screen whatever GDK_SCALE is set
to).

But I don't think that's the real problem - I think the mouse coordinate
to survey coordinate mapping needs adjusting for hidpi.  If I drag the
survey up and left and then try moving the mouse around twice as far
from the top left corner as the survey I can see it highlighting
stations in the wrong place.

Shift+left drag to select an area shows more clearly what is wrong (at
least if this is the same for you as me).

> > Is hidpi actually always 2x currently?  If so we could probably ship
> > a pre-calculated bitmap font that's suitable for 2x for now.
> 
> 3x is reasonable on my screen (283dpi vs typical nominal 96dpi) but 2x
> is useable, unlike 1x.

FWIW, my laptop (which is nothing new or fancy) seems to be 131dpi at
max res (1600x900 with a screen 310mm wide).

Anyway, we could potentially ship 2x and 3x font versions I guess, but
this approach doesn't scale so well if there are very many scales to
support.

Cheers,
    Olly



More information about the Survex mailing list