New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for HiDPI #1951

Open
marmarek opened this Issue May 4, 2016 · 13 comments

Comments

Projects
None yet
8 participants
@marmarek
Member

marmarek commented May 4, 2016

For having full HiDPI support in Qubes, we need:

  • have dom0 desktop environment support - upgrade dom0 to Fedora 23 should do - #1807
  • have VM applications/toolkits support - Fedora 23 probably is good enough
  • somehow inform the VM about the DPI
  • possibly improve GUI performance

The last one may be really hard, if turn out to be a problem - because VM have no hardware graphics acceleration, so all that is computed on CPU.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 4, 2016

Member

Regarding informing VM about DPI, the most straightforward (I think) solution would be to pass physical screen size along with its resolution (qubes.SetMonitorLayout qrexec service). But this may pose a big privacy issue, especially for Whonix VMs.
One solution would be to disable this feature for Whonix VMs, but that means no HiDPI support for Whonix. Another idea is to pass some different information - for example some approximate DPI value - like one of 96, 150, 300 and so on.

@adrelanos what would be the best option? Maybe something different?

Member

marmarek commented May 4, 2016

Regarding informing VM about DPI, the most straightforward (I think) solution would be to pass physical screen size along with its resolution (qubes.SetMonitorLayout qrexec service). But this may pose a big privacy issue, especially for Whonix VMs.
One solution would be to disable this feature for Whonix VMs, but that means no HiDPI support for Whonix. Another idea is to pass some different information - for example some approximate DPI value - like one of 96, 150, 300 and so on.

@adrelanos what would be the best option? Maybe something different?

marmarek added a commit to marmarek/old-qubes-gui-agent-linux that referenced this issue May 4, 2016

Reserve extra space in monitor-layout protocol
This is a place for future extension - for example screen DPI.

QubesOS/qubes-issues#1951
@marmarek

This comment has been minimized.

Show comment
Hide comment
Member

marmarek commented May 7, 2016

Related message about informing DPI to the VMs: https://groups.google.com/d/msgid/qubes-devel/56E49569.9020506%40noses.com

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 4, 2016

Member

Status update for Qubes 3.2:

  • installer handle HiDPI nicely - enable scaling automatically so it's readable
  • KDE5 (dom0) doesn't automatically enable it, but it's a matter of one setting: Increase font dpi (System Settings → Font → Force font dpi, enter a number such as 125, 144 or 150 etc); and if you like, increase icon sizes
  • VM - no progress yet. Probably require minor modification of dummyqbs xorg driver (expose an interface to set dPtr->paOutputs[i]->mm_width (and mm_height).
Member

marmarek commented Jun 4, 2016

Status update for Qubes 3.2:

  • installer handle HiDPI nicely - enable scaling automatically so it's readable
  • KDE5 (dom0) doesn't automatically enable it, but it's a matter of one setting: Increase font dpi (System Settings → Font → Force font dpi, enter a number such as 125, 144 or 150 etc); and if you like, increase icon sizes
  • VM - no progress yet. Probably require minor modification of dummyqbs xorg driver (expose an interface to set dPtr->paOutputs[i]->mm_width (and mm_height).

marmarek added a commit to QubesOS/qubes-gui-agent-linux that referenced this issue Jun 25, 2016

Reserve extra space in monitor-layout protocol
This is a place for future extension - for example screen DPI.

QubesOS/qubes-issues#1951

(cherry picked from commit 6b675f5)
@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Jul 5, 2016

Member

On 2016-07-04 14:05, R.B. wrote:

Hello,

For the people who want to use a HIDPI display, or have one on their
laptop, Here's an easy way to get your vm's up to scale while issue
#1951 is open ;-)

Settings that I use on my machine with 3.2rc1:
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.desktop.interface text-scaling-factor 0.75

You could run it through qvm-run from dom0 for all your vm's.

Note that for some reason it won't affect templates. The
(gnome-)terminal for instance remains the same size and scale.

For reference: #1951

Enjoy.

Regards,

RB

Original message

Member

andrewdavidwong commented Jul 5, 2016

On 2016-07-04 14:05, R.B. wrote:

Hello,

For the people who want to use a HIDPI display, or have one on their
laptop, Here's an easy way to get your vm's up to scale while issue
#1951 is open ;-)

Settings that I use on my machine with 3.2rc1:
gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.desktop.interface text-scaling-factor 0.75

You could run it through qvm-run from dom0 for all your vm's.

Note that for some reason it won't affect templates. The
(gnome-)terminal for instance remains the same size and scale.

For reference: #1951

Enjoy.

Regards,

RB

Original message

@marmarek marmarek modified the milestones: Release 4.0, Release 3.2 Jul 15, 2016

@brinded

This comment has been minimized.

Show comment
Hide comment
@brinded

brinded Jul 21, 2016

Awesome! I will readily volunteer my time on any tests regarding HiDPI as I love Qubes and have a 4k laptop (Y50-70). Of note, xrandr pulls up the correct info in regards to resolution (3840x2160) and display size of 344mm x 194mm. However, xdpyinfo returns the same resolution and a display size of 1016mm x 571mm yielding 96dpi. I'm plugging my way through it.

That being said, Fedora 24 with GNome handled it extremely well.

brinded commented Jul 21, 2016

Awesome! I will readily volunteer my time on any tests regarding HiDPI as I love Qubes and have a 4k laptop (Y50-70). Of note, xrandr pulls up the correct info in regards to resolution (3840x2160) and display size of 344mm x 194mm. However, xdpyinfo returns the same resolution and a display size of 1016mm x 571mm yielding 96dpi. I'm plugging my way through it.

That being said, Fedora 24 with GNome handled it extremely well.

marmarek added a commit to marmarek/old-qubes-gui-agent-linux that referenced this issue Jul 22, 2016

xf86-video-dummy: changeable physical output size
Add WIDTH_MM and HEIGHT_MM output properties to allow setting "physical"
size of the output. Normally this data is retrieved from EDID, but for
obvious reasons it can't be done in the VM.
This patch allows to set this properties from user space. This is later
reported as output size (the header line describing the output in
`xrandr` output).

QubesOS/qubes-issues#1951
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 22, 2016

Member

I've added support for custom screen/output size to video driver. It can be even changed on the fly :)
When manually set to HiDPI-suggesting values (DPI > 200), gnome-terminal (and probably other GTK+ applications) in Fedora 23 VM automatically turns on font scaling. According to gnome-settings-daemon sources, it is triggered on:

  • DPI >= 192
  • height >= 1200px

Those properties expect screen size in mm.

The easiest thing to do would be to pass actual screen size from dom0 directly. But (I guess) this would be major problem for Whonix VMs as physical screen size is even more unique than just resolution. @adrelanos what do you think? I've already proposed some solution in #1951 (comment) - is it ok?

Member

marmarek commented Jul 22, 2016

I've added support for custom screen/output size to video driver. It can be even changed on the fly :)
When manually set to HiDPI-suggesting values (DPI > 200), gnome-terminal (and probably other GTK+ applications) in Fedora 23 VM automatically turns on font scaling. According to gnome-settings-daemon sources, it is triggered on:

  • DPI >= 192
  • height >= 1200px

Those properties expect screen size in mm.

The easiest thing to do would be to pass actual screen size from dom0 directly. But (I guess) this would be major problem for Whonix VMs as physical screen size is even more unique than just resolution. @adrelanos what do you think? I've already proposed some solution in #1951 (comment) - is it ok?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 23, 2016

Member

I am not sure yet. Does this require a quick answer?

Another idea is to pass some different information - for example some approximate DPI value - like one of 96, 150, 300 and so on.

This sounds best. The more common the value is, the better.

Member

adrelanos commented Jul 23, 2016

I am not sure yet. Does this require a quick answer?

Another idea is to pass some different information - for example some approximate DPI value - like one of 96, 150, 300 and so on.

This sounds best. The more common the value is, the better.

marmarek added a commit to marmarek/old-qubes-gui-agent-linux that referenced this issue Aug 6, 2016

xf86-video-dummy: changeable physical output size
Add WIDTH_MM and HEIGHT_MM output properties to allow setting "physical"
size of the output. Normally this data is retrieved from EDID, but for
obvious reasons it can't be done in the VM.
This patch allows to set this properties from user space. This is later
reported as output size (the header line describing the output in
`xrandr` output).

QubesOS/qubes-issues#1951

marmarek added a commit to marmarek/old-qubes-gui-agent-linux that referenced this issue Aug 6, 2016

Extendt qubes.SetMonitorLayout to support also physical dimensions
Now format of each line is:
 W H X Y W_MM H_MM
where:
 - W, H - output dimensions in pixels
 - X, Y - output position in pixels
 - W_MM, H_MM - output dimensions in millimeters

W_MM and H_MM are optional.

As noted in QubesOS/qubes-issues#1951 physical dimensions may be
intentionally inaccurate for privacy reasons.

QubesOS/qubes-issues#1951

marmarek added a commit to marmarek/old-qubes-gui-daemon that referenced this issue Aug 8, 2016

Send approximate physical screen dimensions to the VM
When properly set, applications will have a chance to automatically
detect HiDPI and act accordingly. This is the case for Fedora 23
template and GNOME apps (maybe even all built on top of GTK).

But for privacy reasons, don't provide real values, only some
approximate one. Give enough information to distinguish DPI above 150,
200 and 300. This is some compromise between privacy and HiDPI support.

QubesOS/qubes-issues#1951

WetwareLabs added a commit to WetwareLabs/qubes-gui-daemon that referenced this issue Aug 8, 2016

Send approximate physical screen dimensions to the VM
When properly set, applications will have a chance to automatically
detect HiDPI and act accordingly. This is the case for Fedora 23
template and GNOME apps (maybe even all built on top of GTK).

But for privacy reasons, don't provide real values, only some
approximate one. Give enough information to distinguish DPI above 150,
200 and 300. This is some compromise between privacy and HiDPI support.

QubesOS/qubes-issues#1951

marmarek added a commit to marmarek/old-qubes-core-admin that referenced this issue Aug 9, 2016

Send approximate physical screen dimensions to the VM
When properly set, applications will have a chance to automatically
detect HiDPI and act accordingly. This is the case for Fedora 23
template and GNOME apps (maybe even all built on top of GTK).

But for privacy reasons, don't provide real values, only some
approximate one. Give enough information to distinguish DPI above 150,
200 and 300. This is some compromise between privacy and HiDPI support.

QubesOS/qubes-issues#1951

This commit is migrated from gui-daemon repository
(dec462795d14a336bf27cc46948bbd592c307401).
@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Nov 28, 2016

Member

I've marked the first two items as complete since we have F23 in dom0 and an F24 template now.

Member

andrewdavidwong commented Nov 28, 2016

I've marked the first two items as complete since we have F23 in dom0 and an F24 template now.

@najamelan

This comment has been minimized.

Show comment
Hide comment
@najamelan

najamelan Dec 27, 2017

This message of the user mailing list might be of interest. I can confirm it works on Q4RC3. After rebooting the template, it's dpi is correct, and it is also propagated to all app vms:

The only way I found to get a reasonable view is to change the default 96 dpi setting of Xft.dpi in /etc/X11/Xresources (in the TemplateVM).

For the whonix-ws template it works when adding it to /etc/X11/Xresources/x11-common

najamelan commented Dec 27, 2017

This message of the user mailing list might be of interest. I can confirm it works on Q4RC3. After rebooting the template, it's dpi is correct, and it is also propagated to all app vms:

The only way I found to get a reasonable view is to change the default 96 dpi setting of Xft.dpi in /etc/X11/Xresources (in the TemplateVM).

For the whonix-ws template it works when adding it to /etc/X11/Xresources/x11-common

@mossy-nw

This comment has been minimized.

Show comment
Hide comment
@mossy-nw

mossy-nw Feb 8, 2018

setting Xft.dpi to >96 isn't working for me in R4.0_rc4 for debian-9 or fedora-26 templates (whonix not tested).

However, in VMs with fedora-26 templates this solution from R3.2 is working again (running commands in the VM terminal on launch):

gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.desktop.interface text-scaling-factor 0.75

This fails (with no apparent effect) in VMs with debian-9 templates, with the following error:

dconf-WARNING **: unable to open file '/etc/dconf/db/local': Failed to open file '/etc/dconf/db/local': open() failed: No such file or directory; expect degraded performance

mossy-nw commented Feb 8, 2018

setting Xft.dpi to >96 isn't working for me in R4.0_rc4 for debian-9 or fedora-26 templates (whonix not tested).

However, in VMs with fedora-26 templates this solution from R3.2 is working again (running commands in the VM terminal on launch):

gsettings set org.gnome.desktop.interface scaling-factor 2
gsettings set org.gnome.desktop.interface text-scaling-factor 0.75

This fails (with no apparent effect) in VMs with debian-9 templates, with the following error:

dconf-WARNING **: unable to open file '/etc/dconf/db/local': Failed to open file '/etc/dconf/db/local': open() failed: No such file or directory; expect degraded performance
@mossy-nw

This comment has been minimized.

Show comment
Hide comment
@mossy-nw

mossy-nw Feb 8, 2018

in R4.0_rc4, for at least one (electron-based) app using a debian-9 template, running the following command in a terminal before launching the app did the trick:

echo Xft.dpi: 144 | xrdb -merge

This also works for torbrowser in a whonix-ws based VM.

mossy-nw commented Feb 8, 2018

in R4.0_rc4, for at least one (electron-based) app using a debian-9 template, running the following command in a terminal before launching the app did the trick:

echo Xft.dpi: 144 | xrdb -merge

This also works for torbrowser in a whonix-ws based VM.

@taradiddles taradiddles referenced this issue in Qubes-Community/Contents Mar 26, 2018

Closed

Doc suggestion: change dpi scaling uniformly in dom0 and VMs #11

8 of 14 tasks complete
@taradiddles

This comment has been minimized.

Show comment
Hide comment
@taradiddles

taradiddles Apr 16, 2018

just found out that setting DPI scaling depends on the presence of the /usr/libexec/gsd-xsettings daemon (provided by the gnome-settings-daemon package in fedora):

  • without /usr/libexec/gsd-xsettings running, applications honor Xft.dpi
  • with /usr/libexec/gsd-xsettings running, applications are prevented from using Xft.dpi so the gsettings commands have to used.

I've documented this in https://github.com/Qubes-Community/Contents/blob/master/docs/customization/dpi-scaling.md ; if it gets enough testing (eg. for kde/qt apps) I can submit a PR to the official docs.

just found out that setting DPI scaling depends on the presence of the /usr/libexec/gsd-xsettings daemon (provided by the gnome-settings-daemon package in fedora):

  • without /usr/libexec/gsd-xsettings running, applications honor Xft.dpi
  • with /usr/libexec/gsd-xsettings running, applications are prevented from using Xft.dpi so the gsettings commands have to used.

I've documented this in https://github.com/Qubes-Community/Contents/blob/master/docs/customization/dpi-scaling.md ; if it gets enough testing (eg. for kde/qt apps) I can submit a PR to the official docs.

@ncm

This comment has been minimized.

Show comment
Hide comment
@ncm

ncm Apr 28, 2018

For the "expect degraded performance" problem, I created
# ln -s /home/user/.config/dconf/user /etc/dconf/db/local
in my debian-9 template. The complaint went away. Dunno about the "degraded performance".

ncm commented Apr 28, 2018

For the "expect degraded performance" problem, I created
# ln -s /home/user/.config/dconf/user /etc/dconf/db/local
in my debian-9 template. The complaint went away. Dunno about the "degraded performance".

marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue May 2, 2018

Require dconf utility to (re)build /etc/dconf/db/local
Some applications complains if compiled version of dconf database is
missing ("dconf-WARNING **: unable to open file '/etc/dconf/db/local':
Failed to open file '/etc/dconf/db/local': open() failed: No such file
or directory; expect degraded performance").
There is only one entry in that database, but generate its binary
version anyway to avoid that warning message.

The dconf call is already included in package scripts, now only make
sure the utility is really installed.

QubesOS/qubes-issues#1951

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status May 2, 2018

Closed

core-agent-linux v4.0.27 (r4.0) #496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment