elementary / greeter

Login and Lock Screen greeter for elementary OS and Pantheon, using LightDM
GNU General Public License v3.0
153 stars 39 forks source link

Greeter does not follow user's scaling factor #160

Open DanyGee opened 5 years ago

DanyGee commented 5 years ago

Installed Juno Beta 2 fresh. Got 4K resolution on the greeter and desktop - everything not scaled up, thus tiny and barely readable. After installing nvidia driver 390.48 and restarting the system the greeter stays at 4K and still not scaled up (tiny elements), but the desktop got properly scaled up x2 times, and thats OK.

Back to greeter... The pointer on the greeter is properly scaled up x2 times, but as soon as I hover it on password field, it gets shrunken again. When I move it back away, it gets scaled up again. Rest of the greeter elements are not scaled up.

I thought this scaling issue will finally be solved. Guess not yet. Is there any working fix for this? What is wrong with this magic greeter?

My Specs:

System:    Host: elementary-os-beta2 Kernel: 4.15.0-34-generic x86_64 bits: 64 compiler: gcc v: 7.3.0 
           Desktop: Pantheon Distro: elementary OS 5.0 Juno base: Ubuntu 18.04 bionic 
Machine:   Type: Desktop Mobo: ASUSTeK model: Z170-DELUXE v: Rev 1.xx serial: <filter> 
           UEFI [Legacy]: American Megatrends v: 3504 date: 06/29/2017 
CPU:       Topology: Quad Core model: Intel Core i7-6700K bits: 64 type: MT MCP arch: Skylake-S rev: 3 
           L2 cache: 8192 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 64128 
           Speed: 800 MHz min/max: 800/4300 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 
           7: 800 8: 800 
Graphics:  Device-1: NVIDIA GP104 [GeForce GTX 1080] driver: nvidia v: 390.48 bus ID: 01:00.0 
           Display: x11 server: X.Org 1.19.6 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa 
           resolution: 3840x2160~60Hz 
           OpenGL: renderer: GeForce GTX 1080/PCIe/SSE2 v: 4.6.0 NVIDIA 390.48 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-H HD Audio driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           Device-2: NVIDIA GP104 High Definition Audio driver: snd_hda_intel v: kernel bus ID: 01:00.1 
           Sound Server: ALSA v: k4.15.0-34-generic 
Network:   Device-1: Intel Ethernet I219-V driver: e1000e v: 3.2.6-k port: f000 bus ID: 00:1f.6 
           IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           Device-2: Broadcom Limited BCM4360 802.11ac Wireless Network Adapter driver: bcma-pci-bridge v: N/A 
           port: e000 bus ID: 07:00.0 
           Device-3: Intel I211 Gigabit Network driver: igb v: 5.4.0-k port: c000 bus ID: 0b:00.0 
           IF: enp11s0 state: down mac: <filter> 
Drives:    Local Storage: total: 2.34 TiB used: 35.64 GiB (1.5%) 
           ID-1: /dev/sda vendor: Samsung model: SSD 850 PRO 256GB size: 238.47 GiB 
           ID-2: /dev/sdb vendor: Samsung model: SSD 850 PRO 1TB size: 953.87 GiB 
           ID-3: /dev/sdc vendor: Crucial model: CT1050MX300SSD1 size: 978.09 GiB 
           ID-4: /dev/sdd vendor: Kingston model: SH100S3120G size: 111.79 GiB 
           ID-5: /dev/sde vendor: Kingston model: SV300S37A120G size: 111.79 GiB 
Partition: ID-1: / size: 109.53 GiB used: 35.64 GiB (32.5%) fs: ext4 dev: /dev/sde1 
Sensors:   System Temperatures: cpu: 36.0 C mobo: N/A gpu: nvidia temp: 52 C 
           Fan Speeds (RPM): cpu: 0 gpu: nvidia fan: 0% 
Info:      Processes: 251 Uptime: 1h 02m Memory: 31.35 GiB used: 2.73 GiB (8.7%) Init: systemd runlevel: 5 
           Compilers: gcc: 7.3.0 Shell: bash v: 4.4.19 inxi: 3.0.25

If more info is needed - ask, I'll provide. Cheers

cassidyjames commented 5 years ago

@DannyGee what it the physical size of your display?

DanyGee commented 5 years ago

The physical size is 55". Its a LG TV, model OLED55B7V. Elementary OS just rapes my eyes with crispness on it :eyes:

fabianthoma commented 5 years ago

That could be the problem here. Technically 4K on 55" is not hidpi, because a 55" screen is actually 4 times bigger than a normal screen used for a desktop. It won't switch the screen to Hidpi mode for you because the DPI (Dots per inch) is actually reasonable if it were a normal computer screen. So I guess we need a way to switch to Hidpi mode manually, and also to do that for the whole system.

DanyGee commented 5 years ago

That could be the problem here. Technically 4K on 55" is not hidpi, because a 55" screen is actually 4 times bigger than a normal screen used for a desktop. It won't switch the screen to Hidpi mode for you because the DPI (Dots per inch) is actually reasonable if it were a normal computer screen. So I guess we need a way to switch to Hidpi mode manually, and also to do that for the whole system.

What? Complete bullshit. Then explain why is the desktop scaled properly x2 times (and not 4x times), huh?

cassidyjames commented 5 years ago

@DanyGee please try and remain respectful in discussions here. @fabianthoma is correct in that by default, the system uses the display's DPI to determine whether or not to scale. I believe this value is 192, but it's determined by GNOME Settings Daemon in the session. Since a 55" display with 3840×2160 is 80 DPI, the system sees it as "loDPI" and does not scale.

As for "4 times bigger," it's twice as large in each of the two dimensions, or four times larger total. 2x scaling draws each virtual pixel with four physical pixels. Fabian was saying that a 55" display is about 4x the area of a "typical" desktop display, so 4x the total pixels could make sense running at 1x.

As for why the session scales to 2x by default, I'm not sure. I suspect the NVIDIA driver may be doing something strange there, or at some point the Scaling Factor in System Settings → Displays was changed.

I think the actual issue here is that manually setting the scaling factor in the session should set it for the greeter as well. Then we can go from there.

DanyGee commented 5 years ago

Damn, you were right! screenshot from 2018-09-30 23 25 25 2x Now I understand it - >>dots per inch<< stupid! - pretty self-explanatory :sweat_smile: I'm sorry for being rude @fabianthoma , hope u don't mind :handshake: - I just can't wait for fully working out of the box scaling :heart: Misleading is the fact, that the desktop itself scales properly. It's hard to understand, why two modules of the same system scale totally different.

I think the actual issue here is that manually setting the scaling factor in the session should set it for the greeter as well. Then we can go from there.

Current scaling factor in my settings was showing PixelDoubled. Changed it to loDPI - it resulted in not scaled greeter and desktop. Changed it to automatic - the same, both not scaled. Changed it back to Pixel Doubled - greeter not scaled, desktop scaled properly.

Any other ideas how to tackle it further? :bulb:

Funny, nVidia sees it as 96dpi: screenshot from 2018-10-01 01 04 58 2x If there was a way to force dpi in greeter... :thinking: Or at least a way to force greeter resolution to 1920x1080? I remember there was a workaround involving a line in greeter config... display-setup-script=xrandr -s 1920x1080 ...but pantheon greeter seems to ignore it for some reason. This method works on Mint for example.

cassidyjames commented 5 years ago

@DanyGee alright, yeah so this seems to be the actual issue: System Settings does not set the scaling factor for the greeter, and/or the greeter is not respecting the user's scaling factor.

vjr commented 5 years ago

I set it manually via gschema.xml as in the answer in this post: https://askubuntu.com/questions/906797/scaling-gnome-login-screen-on-hidpi-display/912789

This is a global setting not per user which is why greeter seems to pick it up for me.

DanyGee commented 5 years ago

Nice work @vjr ! Thank you! Your workaround does, what it supposed to - the greeter gets scaled now x2 times too, just as the desktop. Thought the desktop will additionally scale x2 times more, but it didn't :sweat_smile: The only little downside noticed is thta the most elements got slightly lower resolution, so little jaggies are noticable... 20181002_075829 (notice the BT icon and compare it to high res net and power icons) 20181002_075844 ...and this fella, randomly gets one time a bit higher res... 20181002_075834

...and one time a bit lower res 20181002_080250

For the time being, I can live with that workaround :tada: Hope all this information will help the devs to automate the scaling properly now.

UPDATE 1 The clock res changes from low to high when the minute changes. So, if you lock at 8:21 and stay on the lockscreen, at 8:22 the clock will refresh and change to hi res. The login box changes its res when you enter nothing and try to log in - it will shake and refresh to hi res too. Disabling and enabling the BT also refreshes its icon to hi res. The changes last only till the next lockdown. If we figure a way to change the res of the elements permanently, we got tha case cracked :tada:

peteruithoven commented 5 years ago

I can reproduce this login box lo res > high res after failed login. This except for the default user badge. Is there a way to trigger a refresh?

peteruithoven commented 5 years ago

I see a lot of overlap with: https://github.com/elementary/greeter/issues/7

DanyGee commented 5 years ago

I can reproduce this login box lo res > high res after failed login. This except for the default user badge. Is there a way to trigger a refresh?

Here's a video of how I reproduce it: https://photos.app.goo.gl/xhjZ3M8fVoRzwrgH8 Net and power icons are hires. The clock changes to hires on its own every minute and the only little thing not changing its resolution is the blue checkmark near the avatar.

cassidyjames commented 5 years ago

Please keep the blurriness issue discussion over at #7, @peteruithoven seems to be right that there's overlap. I'd like to restrict the scope of this issue to the fact that the greeter does not appear to be following the user session's scaling factor settings.

ianwalter commented 5 years ago

@cassidyjames I think the 192 threshold is too high. My desktop display dimensions are not uncommon are they? Dell 27" 4k (3840x2160) 16:9 = 163 DPI according to Dippi and I'm having the same problem. I manually changed the Scaling factor to Pixel Doubled because everything was WAY too small even when sitting pretty (maybe too) close to the monitor.

What about having the 192 DPI threshold up until a certain display size and then lowering the threshold as the display gets larger?

Terrific work by the way!

patbec commented 5 years ago

I have the same problem. If someone spends his time fixing it: Here a little thank you. (www.bountysource.com)

DanyGee commented 5 years ago

Found out yesterday that greeter also does not respect user's wallpaper scaling settings. It just uses zoom by default. If you set your wallpaper scaling to spanned, it won't get spanned in greeter resulting some unpleasant switch while loging in.

aral commented 3 years ago

Hi all,

As someone who runs into this on their 4K 27" screen on 5.1.7 (lo-dpi greeter even though the main interface is pixel doubled) may I suggest that the low-priority tag be taken off this issue.

Insofar as a regular person using their computer is concerned, they’ve set their display to be pixel doubled. Then, there’s a bug that means that it forgets that setting and shows their log in screen at low dpi.

All parts of the operating system should behave consistently as there is only one operating system (only those of us here on GitHub know or care that there are separate modules). For everyday people who use computers as an everyday thing (like brain surgeons, for example), there is only their computer. And in this case, the computer forgets their setting on the login screen.

So I’d triage this as a high-priority bug as it impacts the experience at the start of every day and perhaps several times throughout.

If you feel this is a good first issue to tackle, I’m happy to take it on.

davidmhewitt commented 3 years ago

I guess this is marked as low priority due to the small number of people it's probably affecting rather than how annoying it is when it happens. The greeter automatically switches to 2x scaling on displays that are definitely considered HiDPI. This happens for the main session too. This all works seamlessly on my laptop with a 13" 3200x1800 display. I don't have to worry about manually changing the setting for the main session and the greeter automatically picks the right scaling. However, if your display falls out of this "magic range" of displays that are considered HiDPI, then yes, I can see it being annoying.

As for solving it, this would likely be handled in https://github.com/elementary/settings-daemon/

We'd need another property adding to https://github.com/elementary/settings-daemon/blob/master/data/io.elementary.SettingsDaemon.AccountsService.xml to store the setting.

Then we'd need some code similar to this to listen for the /org/gnome/desktop/interface/scaling-factor GSettings key changing, then synchronising it to the new AccountsService property when it does: https://github.com/elementary/settings-daemon/blob/master/src/Backends/KeyboardSettings.vala

Finally, there would then need to be some code in the greeter to pick up this setting from AccountsService and apply it back to the same GSettings key. There is already code in the greeter that does this for the keyboard settings.

It's a bit fiddly for a first issue, but if you wanted to give it a shot and ping me for advice if you get stuck, feel free.

aral commented 3 years ago

@davidmhewitt Thanks; that seems straightforward and is basically what I had in mind also but I didn’t know where to look for all the various bits (now I do, thanks to your detailed response). So, cool, if no one objects I can take this on, then. Should give me a better idea of what all the bits are and how they fit together too. And thank you, I’ll take you up on your offer if I get stuck.

Oh, and also, what’s the done thing: should I work on this on my daily driver 5.1.7 machine or on a 6.x install and then backport or… (if there’s a resource for getting started with dev on the OS itself that mentions the preferred setup/workflow please feel free to point me at it and I’ll have another look before I start just in case regardless) :)

davidmhewitt commented 3 years ago

I was just typing up a response about versions etc and then saw your post update asking the question!

I don't think the settings-daemon project is deployed/tested on 5.1 yet, so you may find that developing and testing this will be easier on 6.0 builds. I don't think there's any reason why it shouldn't work on 5.1, but it's one less variable to consider if you find things aren't working as you'd expect.

As for workflow, since both the settings-daemon and greeter project can only really be tested by running them for real, you're going to have to build and install them over the installed versions of the packages. The README in each project has the instructions for doing so. However, it's probably best not to do this on your daily driver unless you're comfortable with your ability to re-install the greeter or recover your session from a TTY/recovery mode should you break something. There's a little bit of additional information (tips and tricks style) on how to install dependencies, restore original packages, debug, etc.. here: https://elementary.io/docs/code/os-dev

aral commented 3 years ago

Perfect, thanks @davidmhewitt. I’ve got 6.x installed on my PineBook Pro so I might do it there or dev on a virtual machine.

caitp commented 1 year ago

I'm having this issue with an LG 27GN950-B, a 27" display with a native 3840x2160 resolution. I'd prefer it if, in addition to having clever autoselection of the scaling factor, there could be a widget on screen to select a scaling factor, just in case the determined scaling factor is the wrong choice. This widget could be disabled for people who find it offensive.

If it seems reasonable, I'd be up for helping out with it in some way.