[QGIS-Developer] Development / HiDPI / Linux

Nyall Dawson nyall.dawson at gmail.com
Mon Oct 16 16:19:43 PDT 2017


On 17 October 2017 at 00:44, Matthias Kuhn <matthias at opengis.ch> wrote:
> Hi developers,
>
> Just for a couple of days I'm a happy owner of a HiDPI device on which I
> immediately setup Fedora 27 which ships with Gnome 3.26, wayland, Qt 5.9
> and all the other nice new libraries and stuff.
>
> Trying to develop (and use the system otherwise) I failed terribly to
> get a satisfactory configuration for QGIS development (and also
> otherwise). There are a few knobs to "finetune" DPI, but I just seem not
> to be able to get things right. Each variable I set somewhere has
> side-effects somewhere else.

Thanks for bringing up this discussion! I suffer with this too (Dell
xps 15 - what's yours?).

Honestly I don't think the hidpi is worth the hassle it causes, and if
it were possible I'd just run it in a lower resolution, and let
Qt/Gnome/Wayland/some other QGIS developer/etc deal with the issues
for now. Unfortunately my laptop doesn't support any lower resolutions
with the correct aspect ratio. grr. So let's try to solve this
correctly!

> * Gnome itself already has a scale setting which at 100% makes things
> very, very tiny and at 200% (the only other option) makes everything
> grandma mode.

Is this the "window scaling" setting under tweak tool? For me a
scaling of 2 works nicely for all gnome applications. Fonts and
spacing are certainly larger than i'd ideally like, but that's gnome
for you (and i see this on my low-dpi desktop too).

My experience (fedora 26, gnome, windows scaling of 2) is that this
makes Qt Creator almost unusable (although you get used to clicking
tiny tiny buttons.... at least the font size can be fixed). QGIS works
generally OK like this. There's some tiny icons in tree views and
various widget chrome, but I don't think any of this is our fault or
indeed anything wrong at QGIS' end. On the plus side, the map canvas
and composer are fully hidpi and look super-smooth. Oh, we do have
some issues in QGIS too, like https://issues.qgis.org/issues/12671.

> * Then there is also the environment variable
> QT_AUTO_SCREEN_SCALE_FACTOR which seems to make Qt Creator a bit more
> usable. (Qt Creator internally actually seems to be using two different
> dpi's - probably QML vs. QWidget issues) But with this env variable set,
> the QGIS interface seems to be scaled up twice.

This makes QGIS a bit more usable, but for me results in low-dpi
scaled up canvas and composer. Also there's an issue in the color
dialogs (can't find it on hub, but it's there somewhere) where the
sliders have "gaps" in the color ramps. I suspect this is because we
need to use the qreal painter methods instead of int, but haven't
checked this.

> * And I read somewhere about xrandr for additional zooming, but I'm
> neither convinced that this is a good approach since some mouse setting
> apparently needs to compensate for this, nor does this seem to have any
> effect (probably because of Wayland) Source:
> https://wiki.archlinux.org/index.php/HiDPI

I use xorg. Not sure if that has a big effect here, but I found
various bits of Qt just didn't work correctly under Wayland. I also
got lots of hangs with Qt Creator. That was > 6 months ago though, so
maybe they've been fixed in the meantime.

> So apart from a rant for the mess by GUI frameworks and window managers,
> there's also a question: did anyone succeed to set things up properly?

No. At least, not me.

Just to throw this in... Windows is also a mess, so this isn't a linux
specific issue ;) E.g. libreoffice is totally unusable for me under
windows in hidpi.

Nyall


More information about the QGIS-Developer mailing list