ubuntu-sdk-bugs team mailing list archive
-
ubuntu-sdk-bugs team
-
Mailing list archive
-
Message #00418
[Bug 1275748] [NEW] Ubuntu QPA plugin does not override QScreen::devicePixelRatio
Public bug reported:
In bug 1257721, I made Oxide DPI aware by passing an appropriate device
pixel ratio to Chromium. However, the way this is implemented on Ubuntu
is not really ideal. I expected to be able to read the DPR from
QScreen::devicePixelRatio, but this is always 1.0f on Ubuntu regardless
of the device scale. Instead, device pixel independence is implemented
entirely in ubuntu-ui-toolkit by providing a QML component for
converting between grid units and device pixels, based on an environment
variable called "GRID_UNIT_PX".
For now, I implemented a workaround in Oxide to also set the DPR to
GRID_UNIT_PX / 8 when running with the Ubuntu platform plugin, and
QScreen::devicePixelRatio on all other platforms.
I think that qtubuntu should instead override QScreen::devicePixelRatio
(that could still come from the same environment variable for now), and
ubuntu-ui-toolkit should do the conversion from grid units to device
pixels using this instead.
** Affects: qtubuntu (Ubuntu)
Importance: Undecided
Status: New
** Affects: ubuntu-ui-toolkit (Ubuntu)
Importance: Undecided
Status: New
** Also affects: ubuntu-ui-toolkit (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1275748
Title:
Ubuntu QPA plugin does not override QScreen::devicePixelRatio
Status in “qtubuntu” package in Ubuntu:
New
Status in “ubuntu-ui-toolkit” package in Ubuntu:
New
Bug description:
In bug 1257721, I made Oxide DPI aware by passing an appropriate
device pixel ratio to Chromium. However, the way this is implemented
on Ubuntu is not really ideal. I expected to be able to read the DPR
from QScreen::devicePixelRatio, but this is always 1.0f on Ubuntu
regardless of the device scale. Instead, device pixel independence is
implemented entirely in ubuntu-ui-toolkit by providing a QML component
for converting between grid units and device pixels, based on an
environment variable called "GRID_UNIT_PX".
For now, I implemented a workaround in Oxide to also set the DPR to
GRID_UNIT_PX / 8 when running with the Ubuntu platform plugin, and
QScreen::devicePixelRatio on all other platforms.
I think that qtubuntu should instead override
QScreen::devicePixelRatio (that could still come from the same
environment variable for now), and ubuntu-ui-toolkit should do the
conversion from grid units to device pixels using this instead.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtubuntu/+bug/1275748/+subscriptions
Follow ups
References