Incorrect UI scale on high-resolution desktop

Bug #1642272 reported by Andreas E.
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Triaged
High
Michał Sawicz
Mir
Invalid
High
Unassigned
unity8 (Ubuntu)
Triaged
High
Unassigned

Bug Description

On a hidpi display, the unity8 desktop session in 16.10 has an oversized and inconsistent UI scale. The unity8 session is absolutely not usable for testing (because there is not even enough screen space to display the logout menu item).

The shell+cursor is rendered with a UI scale of at least 2× the correct scale (e.g. 4× the scale of a low-dpi display). Due to this the indicator menus collapse immediately after clicking because they are larger than the screen height.
The content of the scopes window is rendered with 4× the correct scale, giving space for only one icon.

In unity 16.04, the correct scale could be achieved by setting "export GRID_UNIT_PX=16" in .bashrc, however this has no effect anymore when I remove or change it. The issue is also in the guest session.

Ubuntu version: 16.10 (fresh install)

unity8 version: 8.14+16.10.20160 amd64

physical resolution: 3200×1800

resolution used by unity8: 3200×1800 (at first sight I thought it selected a low resolution, but in fact fonts are very sharp).

Revision history for this message
Andreas E. (andreas-e) wrote :
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

What Qt version do you have installed?

Revision history for this message
Gerry Boland (gerboland) wrote :

Hey,
this is weird. Would you be able to open a terminal and run the following command:

xargs -n 1 -0 < /proc/`pidof unity8`/environ | ag GRID_UNIT

(it prints all the environment variables that the unity8 process has, and just returns the GRID_UNIT_PX one)
Thanks
-G

Revision history for this message
Gerry Boland (gerboland) wrote :

Contents of $HOME/.cache/upstart/unity8.log might be handy too

Revision history for this message
Gerry Boland (gerboland) wrote :

Oops, safer to use grep:

xargs -n 1 -0 < /proc/`pidof unity8`/environ | grep GRID_UNIT

Revision history for this message
Gerry Boland (gerboland) wrote :

Could you also share hte output of

xargs -n 1 -0 < /proc/`pidof unity8`/enviro | grep QT_

in case there are Qt dynamic scaling env vars set in your environment too. (e.g. QT_DEVICE_PIXEL_RATIO, QT_AUTO_SCREEN_SCALE_FACTOR, QT_SCALE_FACTOR, QT_SCREEN_SCALE_FACTORS)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please also attach these logs (the second one requires sudo to access):
   ~/.cache/upstart/unity8.log*
   /var/log/lightdm/unity-system-compositor.log

We need them to check that Mir is getting sane physical dimensions for your screen and not reporting crazy information like "this is a 4-inch tablet".

tags: added: unity8-desktop
Changed in unity8 (Ubuntu):
status: New → Incomplete
Changed in canonical-devices-system-image:
status: New → Incomplete
importance: Undecided → High
Changed in unity8 (Ubuntu):
importance: Undecided → High
Changed in mir:
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Andreas E. (andreas-e) wrote :

I have Qt 5.6.1 installed (and ppa:convergent-apps/testing).

xargs -n 1 -0 < /proc/`pidof unity8`/environ | grep GRID_UNIT
GRID_UNIT_PX=20

xargs -n 1 -0 < /proc/`pidof unity8`/environ | grep QT_
QT_DEVICE_PIXEL_RATIO=2
QT_IM_MODULE=ibus
QT_QPA_PLATFORM=ubuntumirclient

Revision history for this message
Andreas E. (andreas-e) wrote :
Revision history for this message
Andreas E. (andreas-e) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. Not a Mir bug. Mir is reporting correct display information all the way to unity8.log at least:

[2016-11-21 04:31:38.606047] mirserver: Initial display configuration:
[2016-11-21 04:31:38.606590] mirserver: 0.37: eDP 13,2" 290x170mm
[2016-11-21 04:31:38.606600] mirserver: Current mode 3200x1800 59,99Hz
[2016-11-21 04:31:38.606619] mirserver: Preferred mode 3200x1800 59,99Hz
[2016-11-21 04:31:38.606625] mirserver: Logical position +0+0

Changed in canonical-devices-system-image:
status: Incomplete → New
Changed in unity8 (Ubuntu):
status: Incomplete → New
Changed in mir:
status: Incomplete → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity8 (Ubuntu):
status: New → Confirmed
summary: - incorrect UI scale on high-resolution desktop
+ Incorrect UI scale on high-resolution desktop (everything is gigantic)
kevin gunn (kgunn72)
Changed in canonical-devices-system-image:
milestone: none → u8c-1
assignee: nobody → Stephen M. Webb (bregma)
Revision history for this message
Andreas E. (andreas-e) wrote : Re: Incorrect UI scale on high-resolution desktop (everything is gigantic)

I discovered: Initially, I had set environment variables in .bashrc for manually triggering the UI scaling of Qt5, Java, etc. During debugging of this issue (as instructed above) I **commented them out** and after loout/login, the incorrect UI scale persisted.

Now I noticed that QT_DEVICE_PIXEL_RATIO=2 and QT_AUTO_SCREEN_SCALE_FACTOR=2 were still set automatically during the boot/login process. Instead of commenting them out, I then set them to 1 in ~/.bashrc but they still were overriden.
QT_DEVICE_PIXEL_RATIO=1
QT_AUTO_SCREEN_SCALE_FACTOR=1
GRID_UNIT_PX=20

Then I set them in ~/.profile and they were not overriden. Moreover, the unity8 session (8.14+16.10.20160922-0ubuntu2) renders in the correct scale and digikam (5.4.0, Qt 5.7.0) as well. It seems like a Qt API break so that not only these variables are not needed anymore for new programs, but their presence now has the inverse effect.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not sure if this is the right bug to mention it in, but I find the opposite problem on 3200x1800 displays more recently... Unity8 is unscaled and tiny.

Changed in canonical-devices-system-image:
assignee: Stephen M. Webb (bregma) → Michał Sawicz (saviq)
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: New → Triaged
Changed in unity8 (Ubuntu):
status: Confirmed → Triaged
summary: - Incorrect UI scale on high-resolution desktop (everything is gigantic)
+ Incorrect UI scale on high-resolution desktop
Revision history for this message
Michał Sawicz (saviq) wrote :

Related: bug #1510968

Changed in canonical-devices-system-image:
milestone: u8c-1 → u8c-2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.