]> git.lyx.org Git - lyx.git/commit
Fix support for screen fractional scaling with Wayland
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 25 Feb 2024 19:17:31 +0000 (20:17 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 29 Feb 2024 09:28:15 +0000 (10:28 +0100)
commit8f61b0859c9bcb8da71f43f94dcf62da41b84ea4
treeb363063808c86ea37fbc869fd369ce4a1e812920
parent23105b2eddd5bb547f3a960c63dc05a8b69a4e28
Fix support for screen fractional scaling with Wayland

The display was wrong when a backing store is in use (which is the case
with Wayland). To fix this in GuiWorkArea::Private::resetScreen(), the
pixelRatio is now stored as a double instead of an int.

Concerning support for QT_SCALE_FACTOR, the existing code was wrong
because this value is already taken into account in devicePixelRatioF
for Qt > 5.6 (no fractional scaling support before that). The
situation is as follows:

                   Qt < 5.6    5.6 <= Qt < 6  Qt 6
devicePixelRatio   int(ratio)  int(ratio)     ratio
devicePixelRatioF  N/A         ratio          ratio

So it is only between Qt 5.6 and Qt 6 that devicePixelRatioF() has to
be used instead of devicePixelRatio().
QGuiApplication::devicePixelRatio() does not have a 'F' version, it
always returns the real thing.

Fixes ticket #13039.
src/LyX.cpp
src/LyX.h
src/frontends/qt/GuiApplication.cpp
src/frontends/qt/GuiView.cpp
src/frontends/qt/GuiWorkArea.cpp