linuxmint / cinnamon-screensaver

The Cinnamon screen locker and screensaver program
GNU General Public License v2.0
151 stars 86 forks source link

Fractional scaling resets on resume after suspend #416

Closed SethosII closed 1 year ago

SethosII commented 2 years ago
 * Cinnamon-Screensaver version: 5.4.4
 * Distribution: Mint 21 64 bit
 * Graphics hardware *and* driver used (graphics part from system information):
  Device-1: AMD Lucienne vendor: Lenovo driver: amdgpu v: kernel pcie: speed: 8 GT/s lanes: 16
    ports: active: eDP-1 empty: DP-1,DP-2,HDMI-A-1 bus-ID: 04:00.0 chip-ID: 1002:164c
  Device-2: Luxvisions Innotech Integrated RGB Camera type: USB driver: uvcvideo bus-ID: 1-3:3
    chip-ID: 30c9:0057
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,vesa gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3072x1920 s-dpi: 120
  Monitor-1: eDP res: 3072x1920 dpi: 273 diag: 337mm (13.3")
  OpenGL: renderer: AMD RENOIR (LLVM 13.0.1 DRM 3.42 5.15.0-46-generic) v: 4.6 Mesa 22.0.5
    direct render: Yes

Issue

Fractional scaling resets on resume after suspend.

Steps to reproduce

  1. set display scaling to e. g. 125 %
  2. suspend notebook
  3. resume notebook
  4. display scaling is reset to the default 100 %

Expected behaviour

The display scaling should be persistent.

Other information

This was reported in cinnamon in the past (e. g. https://github.com/linuxmint/cinnamon/issues/10985) but seems to be a problem with the screensaver as it doesn't happen when Lock the computer when put to sleep is deactivated in the screen saver settings.

Another workaround is to set the following dconf value to something other than the default, e. .g.: gsettings set org.gnome.desktop.interface scaling-factor 1. The default (0) seems to mean automatic.

Latest updates didn't help (cinnamon 5.4.11, muffin 5.4.6).

This was also reported in other cinnamon issues: https://github.com/linuxmint/cinnamon/issues/10879 https://github.com/linuxmint/cinnamon/issues/10998.

VitanovG commented 2 years ago

The gsettings fix do not seem to work for me on Linux Mint 21 cinammon, kernel version 5.15.0-47. Display resets into 200% fractional scaling after unlock of the computer.

plum7500 commented 2 years ago

Scaling does not reset if laptop is rebooted. Only after a suspend.

vrooze commented 2 years ago

I can confirm this also. I work from home a a developer and to save having to reopen everything I suspend the system to save power. Upon resume the scaling seems to be around 200% (4k screen but the UI elements are massive, like 800x600 res) and upon unlocking the screensaver. Cinnamon then goes to safe mode, offers a reload which then fixes the issues. Other times the safe mode doesn't happen and I have to ALT+F2->R to get my scaling back.

This wasn't an issue prior to v21 upgrade

reembs commented 2 years ago

Same issue here. Scaling is set to 150%, everything works well and even survives a reboot. On the other hand if the lid is closed and opened while the machine is active, the scaling resets back to 100%

mtwebster commented 2 years ago

Hi, I made some packages for some changes I've been working on to address these issues and I wouldn't mind people testing them out if they're willing:

There are packages for both Mint 21 and LMDE5 (the 'suspend-config-hidpi-fixes' ones): https://github.com/linuxmint/cinnamon-screensaver/releases

To install, download the packages.tar.gz, then extract it (either by fileroller or running tar xf packages.tar.gz), then open a terminal where the files are and run:

sudo dpkg -i *.deb

Do not try to install by double-clicking from the file manager.

If, for some reason something goes wrong, the update manager should be able to re-install the normal release packages (these are considered a lower version than what you're running now).

Hopefully this addresses the hidpi issues, as well improving some of the coverage issues typical when hotplugging or suspend/resuming.

Thanks a lot!

edit: Updated packages to include some (hopefully) improvements to screen coverage (link is the same though).

Aldarone commented 2 years ago

@mtwebster > I tried your test packages, and it seems to work for me. I have a ThinkPad x270 running Mint 21, I tried by closing the lid and with the "suspend" button in the cinnamon menu.

vrooze commented 2 years ago

@mtwebster

Other than it complaining about downgrading from the +vanessa version it works perfectly!

The issue with 200% scaling when locked (I have a 4k screen and a tiny satellite screen) is fixed The issue with resuming from suspend (assuming this is the same as closing the lid on a laptop) is also fixed!.

I've experienced the desktop being visible for a few seconds before but was never able to reliably reproduce, so can't test that one!

Thanks :)

VitanovG commented 2 years ago

I also tested the packages, for me it kinda works: I close the lid on my laptop (suspend+lock screen) with integrated (AMD) or dedicated gpu (laptop nvidia RTX 3060) and after wakeup I only see a black screen and the cursor. If I type in my password it unlocks and retains my monitor settings of 150% fractional scaling. I would call this a win, as it is not really necessary for me to see the lock screen to know whats up.

Interesting thing is if I lock the screen from taskbar with the integrated gpu then the lockscreen loads in correctly, and after that it even works with the lid. So I am not sure what can be the issue. Dedicated gpu again black screen with cursor if I lock it from the taskbar.

Thanks for the fix!

plum7500 commented 2 years ago

It worked. Using Mint 21 on kernel 5.17. On Framework laptop on Intel 1240p integrated GPU. Thanks for fix.

reembs commented 2 years ago

Works for me too. ASUS ZenBook UX305 Thanks for sharing the packages, and for the quick fix

m4t5 commented 2 years ago

Fixed on T480 - many thanks

SethosII commented 2 years ago

Also fixes it for me.

tsoy commented 2 years ago

Fixed on my T480 as well.

KronosTheLate commented 2 years ago

Fixed on my Lenovo L390 - thanks a bunch <3

mtwebster commented 2 years ago

Hi, great to see positive feedback.

I've updated those packages - the link to them is the same. They should help some of the issues seen when suspending and resuming or hotplugging monitors when the desktop is momentarily sometimes.

If you've downloaded these packages within the last 12 hours you likely already have the most up-to-date packages.

Thanks again all.

AiYoriAoshi commented 2 years ago

Fixed the issue for me that when locking and unlocking the screen the scaling and resolution started switching around a few times which sometimes caused applications to crash. It now takes a few seconds when pressing keyboard shortcut for locking the screen but no switching around anymore.

mst128256 commented 2 years ago

Fixed on T470p - thanks!

Rudxain commented 2 years ago

@mtwebster I got an error:

~/Downloads/packages$ pkexec sudo dpkg -i *.deb
dpkg: error: cannot access archive 'cinnamon-screensaver_5.4.4_amd64.deb': No such file or directory

I followed the install instructions as close as possible

Update: never-mind, I had to login as root

fenriskiba commented 2 years ago

I also tested the packages, for me it kinda works: I close the lid on my laptop (suspend+lock screen) with integrated (AMD) or dedicated gpu (laptop nvidia RTX 3060) and after wakeup I only see a black screen and the cursor. If I type in my password it unlocks and retains my monitor settings of 150% fractional scaling. I would call this a win, as it is not really necessary for me to see the lock screen to know whats up.

Interesting thing is if I lock the screen from taskbar with the integrated gpu then the lockscreen loads in correctly, and after that it even works with the lid. So I am not sure what can be the issue. Dedicated gpu again black screen with cursor if I lock it from the taskbar.

Thanks for the fix!

Same behavior for me on a Frame.work (haven't tried the lock from taskbar though), so it shouldn't be an issue of dedicated graphics since I'm on integrated Intel graphics.

Still, the fixed worked enough that I can use the machine and it still suspends when I close the lid. Hopefully the lock screen will be fixed by the time there's a proper release.

KronosTheLate commented 1 year ago

When will this fix be something installed by default, and not manually retrived by a link in a github issue? And how do I upgrade? I am asking because the fix had been reset at some point, and I had to re-install the fix ^_^

mtwebster commented 1 year ago

It's already merged, it's just waiting for a release.

There are some significant changes, so I want as much testing as possible before releasing it for all.

LinuxOnTheDesktop commented 1 year ago

@mtwebster

Sorry to trouble you, but am I right in thinking that the improved packages have now been released? I'd like to know whether I should remove the hold that I placed on those improved packages.

mtwebster commented 1 year ago

Sorry, no they haven't yet. Still working on it.

NoRefill commented 1 year ago

Yesterday I installed https://github.com/linuxmint/cinnamon-screensaver/releases/tag/master.mint21 and it cleared up issues with the resolution changing when the screensaver kicked in or I hit Ctl-Alt-L to lock the screen, but I just came back to my Linux Mint 21 PC and there is an over sized cursor hanging out in the middle of my screen that is not the current pointer. I tried getting the screensaver to kick in again and that didn't get rid of it. Changing virtual screens did not get rid of it. Finally, I switched to a VT1 and back to VT7 and it is gone. I don't know that the above package caused the issue or not, but I suspect it did. Sorry if this is the wrong place to enter the issue, but this issue is where I found out about the possible fix for the screensaver not properly taking scaling into account. I also have the same issue with the slick-greeter and have created an issue with them.

undoubted commented 1 year ago

I also tested the packages, for me it kinda works: I close the lid on my laptop (suspend+lock screen) with integrated (AMD) or dedicated gpu (laptop nvidia RTX 3060) and after wakeup I only see a black screen and the cursor. If I type in my password it unlocks and retains my monitor settings of 150% fractional scaling. I would call this a win, as it is not really necessary for me to see the lock screen to know whats up.

Interesting thing is if I lock the screen from taskbar with the integrated gpu then the lockscreen loads in correctly, and after that it even works with the lid. So I am not sure what can be the issue. Dedicated gpu again black screen with cursor if I lock it from the taskbar.

Thanks for the fix!

For me, the black screen only appears when all windows are minimized.

VitanovG commented 1 year ago

I also tested the packages, for me it kinda works: I close the lid on my laptop (suspend+lock screen) with integrated (AMD) or dedicated gpu (laptop nvidia RTX 3060) and after wakeup I only see a black screen and the cursor. If I type in my password it unlocks and retains my monitor settings of 150% fractional scaling. I would call this a win, as it is not really necessary for me to see the lock screen to know whats up. Interesting thing is if I lock the screen from taskbar with the integrated gpu then the lockscreen loads in correctly, and after that it even works with the lid. So I am not sure what can be the issue. Dedicated gpu again black screen with cursor if I lock it from the taskbar. Thanks for the fix!

For me, the black screen only appears when all windows are minimized.

You are absolutely right, tested it again and I only get black screen when all windows are minimized. (AMD+nvidia RTX 3060 in laptop)

AtomicRobotMan0101 commented 1 year ago

+1 double-plus good.

Works now on my MSI GP62M 7REX gaming laptop.

Specs attached if interested/needed: https://termbin.com/zxap

AtomicRobotMan0101 commented 1 year ago

When will this fix be something installed by default, and not manually retrived by a link in a github issue? And how do I upgrade? I am asking because the fix had been reset at some point, and I had to re-install the fix ^_^

I'd imagine one needs to stop the update from occurring before these fixes/packages become more permanent.

stop update of package

LinuxOnTheDesktop commented 1 year ago

It looks like the packages that were for testing are now available in the normal manner. Is that right, @mtwebster? Here is the (single) changelog for the packages that I see (once I remove the hold on the existing version of the packages):

cinnamon-screensaver (5.4.5+vanessa) vera; urgency=medium

  [ Michael Webster ]
  * Use github instead of circleci.
  * Clean up readme.
  * Improve event grabber debugging info.
  * Rework behavior surrounding sleep, display changes, fractional scaling.
  * Rework stack management, separate backup locker lifecycle from main screensaver's.
DreamChaser-luzeyu commented 1 year ago

Solved. Thanks.

Hi, great to see positive feedback.

I've updated those packages - the link to them is the same. They should help some of the issues seen when suspending and resuming or hotplugging monitors when the desktop is momentarily sometimes.

If you've downloaded these packages within the last 12 hours you likely already have the most up-to-date packages.

Thanks again all.

n4turalZ0mbie commented 1 year ago

It looks like the packages that were for testing are now available in the normal manner. Is that right, @mtwebster? Here is the (single) changelog for the packages that I see (once I remove the hold on the existing version of the packages):

cinnamon-screensaver (5.4.5+vanessa) vera; urgency=medium

  [ Michael Webster ]
  * Use github instead of circleci.
  * Clean up readme.
  * Improve event grabber debugging info.
  * Rework behavior surrounding sleep, display changes, fractional scaling.
  * Rework stack management, separate backup locker lifecycle from main screensaver's.

For me, this version works (5.4.5+vanessa) in regards of the fractional scaling, and the seizures are gone (before, it started to flash with visible content upon locking), however, the login screen is gone when I want to unlock it. I get a black screen, I can see the cursor, but nothing else. I can enter my password and unlock the computer, but it is not optional. Two steps closer though, I heard about the black screen from someone else, before this update, as well. My computer is Lenovo Yoga Slim 7 Pro R7H 14" with Cinnamon Mint 21,

mtwebster commented 1 year ago

Yes, 5.4.5 has the fixes, sorry for the delay.

@n4turalZ0mbie Can you open another issue for your remaining issue? I'd like to start with fresh perspective for this new version (a lot had to be changed).

If anyone else still has remaining issues after updating to 5.4.5 please open a new issue as well.

Thanks all

n4turalZ0mbie commented 1 year ago

Yes, 5.4.5 has the fixes, sorry for the delay.

@n4turalZ0mbie Can you open another issue for your remaining issue? I'd like to start with fresh perspective for this new version (a lot had to be changed).

If anyone else still has remaining issues after updating to 5.4.5 please open a new issue as well.

Thanks all

Sure, thanks for all the great work! New issue #424