[PATCH] Add support for HiDpi screens

Jean-Marc Lasgouttes lasgouttes at lyx.org
Thu Feb 25 16:32:09 UTC 2021


Le 25/02/2021 à 15:07, Enrico Forestieri a écrit :
> On Sun, Jul 19, 2020 at 08:45:19AM +0200, Stephan Witt wrote:
>> Am 18.07.2020 um 00:06 schrieb Jean-Marc Lasgouttes <lasgouttes at lyx.org>:
>>>
>>> Now that I have a HiDpi screen, I really feel the need to do something.
>>>
>>> This trivial patch works pretty well  with Linux/X11 :)
>>>
>>> Could someone try it it with Windows/Wayland/macOS (with normal dpi or HiDpi).
>>
>> I’m able to run it on HiDpi only (ATM). I patched the code and checked it.
>> There is not visible difference. I can provide screen shots if you want them.
> 
> JMarc, did you forget to apply this? There are reports that it actually
> solves issues (see #11875).

It was indeed never applied. Worse, I am not sure what was in this patch :)

What I would like to do is to add a version of the following code:
https://www.lyx.org/trac/ticket/12060#comment:28

This is code from QBitTorrent, that would obviously need to be adapted 
to our needs:
#if !defined(DISABLE_GUI) && (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
     // Attribute Qt::AA_EnableHighDpiScaling must be set before 
QCoreApplication is created
     if (qgetenv("QT_ENABLE_HIGHDPI_SCALING").isEmpty() && 
qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty())
         Application::setAttribute(Qt::AA_EnableHighDpiScaling, true);
     // HighDPI scale factor policy must be set before QGuiApplication 
is created
     if (qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY").isEmpty())
 
Application::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif


Does it make sense to you?

JMarc


More information about the lyx-devel mailing list