10

I've recently done a clean install of 17.04 on a machine with an Nvidia 750Ti card and a Dell 4K monitor. I'm using the Nvidia binary driver 381.09.

All this works great apart from the fact that the display scaling I set in the Ubuntu Screen Display settings always reverts back to 1 when the machine resumes after suspend. I need to set it at 1.5 otherwise everything goes tiny (BTW why doesn't Ubuntu scale to a sensible default with 4K monitors?)

Does anyone else get this? I can't find any mention of it elsewhere.

BTW I've tried the Nouveau driver and that doesn't wake up my screen at all after suspend. So that route's a non-starter.


Edit: Looks like it's been reported as a confirmed bug here Will monitor to see if anything happens.

4
  • I use intel integrated gfx and noticed the same bug.
    – Greg Dan
    May 18, 2017 at 10:50
  • Does anyone know a workaround? This is extremely annoying bug. It seems that the bug affects all 17.04 users with HiDPI screens.
    – Greg Dan
    May 20, 2017 at 17:40
  • It seems that the bug won't be fixed. Unity is being removed from 17.10. And 16.04 and 16.10 have no this bug.
    – Greg Dan
    Jun 3, 2017 at 11:09
  • Alas, 17.10 still does this on my system, and worse, it only lets you change scaling in 100% jumps, so you either have to live with tiny or massive. It seems Ubuntu can't handle HDPI screens correctly and consistently at all, and it's getting worse with each release. I've now downgraded to 16.04.3 which at least handles fractional scaling. Oct 29, 2017 at 14:21

1 Answer 1

4

For anyone else being frustrated by this bug, here's a quick perl script to watch for changes in the scale_factor value and reset to whatever the value is when the script was first run:

#!/usr/bin/perl -w
use strict;

my $dconf_line = `dconf read /com/ubuntu/user-interface/scale-factor`;
my ($scale_factor) = $dconf_line =~ m/DP1\': (\d+)/;

if ($scale_factor) {
    print STDOUT "Current value of scale_factor: $scale_factor ...\n\n";
} else {
    die "Error: cannot find scale_factor value in dconf\n(value of /com/ubuntu/user-interface/scale-factor was $dconf_line\n\n";
}

open(my $fh, "-|", "dconf watch /com/ubuntu/user-interface/scale-factor");

while (<$fh>) {
    if (m/DP1\': (?!$scale_factor)/) {
        `dconf write /com/ubuntu/user-interface/scale-factor "{'DP1': $scale_factor}"`;
        my $date = `date`;
        print STDOUT "$date -- scaling factor adjusted\n\n";
    }
}

Just leave the script running, and it'll catch and reset any attempts to change away from the value.

Works for me on 17.04 with unity, but it's possible that with the switch to gnome in 17.10 the value is stored in a different dconf registry key -- if so, just replace all instances of the key location in the script with the appropriate one and it should work.

Hope this helps ...

3
  • Very useful. For 16.04 LTS (with Nvidia card), I had to change lines 5, 16, and 17 from DP1 to DP-2 ..
    – david6
    Mar 4, 2018 at 6:22
  • 1
    There is now a PPA with a proper fix applied: launchpad.net/~arter97/+archive/ubuntu/unity Nov 7, 2018 at 16:47
  • I added a customized keyboard shortcut dconf write /com/ubuntu/user-interface/scale-factor "{'DP-1': 12}" for easier manual reset...
    – updogliu
    Aug 29, 2020 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .