https://bugs.kde.org/show_bug.cgi?id=469273

            Bug ID: 469273
           Summary: should we not enforce the environment of
                    QT_AUTO_SCREEN_SCALE_FACTOR under wayland?
    Classification: Plasma
           Product: plasmashell
           Version: 5.27.4
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: Startup process
          Assignee: plasma-b...@kde.org
          Reporter: ihi...@gmail.com
                CC: k...@davidedmundson.co.uk
  Target Milestone: 1.0

Created attachment 158625
  --> https://bugs.kde.org/attachment.cgi?id=158625&action=edit
virtualbox with QT_AUTO_SCREEN_SCALE_FACTOR=0 looks like this very ugly

When it comes to the X11 we will make sure that:
-  [`QT_AUTO_SCREEN_SCALE_FACTOR` is set to
`0`](https://invent.kde.org/plasma/plasma-workspace/-/blob/21cefd1083144e7bc51c6c9b46448a22b0a607f2/startkde/startplasma.cpp#L330)
-  [set up a list of `QT_SCREEN_SCALE_FACTORS` to list every screen's scale
factor](https://invent.kde.org/plasma/plasma-workspace/-/blob/21cefd1083144e7bc51c6c9b46448a22b0a607f2/startkde/startplasma-x11.cpp#L52)

When it comes to the Wayland, the `QT_SCREEN_SCALE_FACTORS` is missing,because
we don't need this,as Wayland support mixed DPI ,and   there scale factors are
sent properly over wl_output

But,when lack of `QT_SCREEN_SCALE_FACTORS` , some QT application,which only
support `xWayland`  need `QT_AUTO_SCREEN_SCALE_FACTOR`  to `1` to make
themselves scale properly

For example, under `xWayland`,with two mixed DPI screen : 
1. [`virtualbox`](https://software.manjaro.org/package/virtualbox) with
`QT_AUTO_SCREEN_SCALE_FACTOR=0` looks like this very ugly,see attachment No.1
2. [`virtualbox`](https://software.manjaro.org/package/virtualbox) with
`QT_AUTO_SCREEN_SCALE_FACTOR=1` , just looks well as windows/X11

I've tried to set `QT_AUTO_SCREEN_SCALE_FACTOR=1` via `/etc/environment` or
`~/.config/plasma-workspace/env/*.sh` or via `systemd` ,none of these works .
I've dive into the code and find out why:

1. `plasma` has settled the environment  here :
https://invent.kde.org/plasma/plasma-workspace/-/blob/21cefd1083144e7bc51c6c9b46448a22b0a607f2/startkde/startplasma.cpp#L330
,  and this `setupPlasmaEnvironment` is called after  `EnvironmentScripts`
https://invent.kde.org/plasma/plasma-workspace/-/blob/21cefd1083144e7bc51c6c9b46448a22b0a607f2/startkde/startplasma-wayland.cpp#L64-L70
,so environments settled in the `EnvironmentScripts` will be overwrite
1. `plasma`  [will export all the settled environment back to
systemd/dbus](https://invent.kde.org/plasma/plasma-workspace/-/blob/21cefd1083144e7bc51c6c9b46448a22b0a607f2/startkde/startplasma-wayland.cpp#L76)
, so  environments settled in the systemd/pam mechanise will be overwrite too

basically,I can do noting to change the value of environment variable
`QT_AUTO_SCREEN_SCALE_FACTOR` ,which cause some QT application which only
support `xWayland` scaled at wrong size and looks ugly

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: `Y`
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to