6

Using Xfce, when I close the notebook lid it suspends, and when I open the lid it wakes up. When it wakes up it shows the screensaver until I press a key or move the mouse then it asks me for my password. All that is working beautifully. The issue is that when I open the lid, for a second or so I can see what is on the desktop, all the open windows, etc. Then it does a fade into the screensaver. The expected behaviour is that I see a blank screen, or the login prompt, immediately.

I've removed the screen saver (set it to be a black screen) but that made no difference.

Is this something that can be configured?

System details: Lenova E540, Mint 16, Xfce 4.10.

(In contrast, my Ubuntu 10.04 notebook did not have this issue: when the case was opened it always showed a blank screen. However I always had to suspend from the power control menu, as closing the case was unreliable as a way to get it to suspend, so maybe that was why??)


More Notes:

(Thanks to Nattgew for finding a related bug report.)

There appears to be a distinct difference between closing the screen, and going to the power manager and choosing suspend.

Close screen: screen visible when opening, then it goes to screensaver, then I have to type password to login. Wifi net connection is preserved.

Explicit suspend: wifi is disconnected. When I resume the screen is visible, it doesn't go to screensaver, it doesn't ask password. It needs to reconnect to wifi. --> FIXED THIS BIT. launch xfce4-session-settings, go to last tab ("Advanced") and mark "Lock screen before sleep" checkbox. You also have to check the checbox that says the same thing in Power Manager preferences!! (Source.) So, now I've fixed this, both ways of suspending show the screen fading away into the screensaver, then prompt for password. However the explicit suspend is still the only one that disconnects wifi.

(Using pm-suspend from the commandline works just like going to the power manager menu.)

2

This seems to be present in a lot of distros. This is a workaround I'm using for Cinnamon on Debian, but it should be possible to do something similar with other distro/window manager combinations:

  1. Use dconf-editor to change the button-suspend action at org>cinnamon>settings-daemon>plugins>power to 'nothing' (you could also amend lid-close-ac-action and lid-close-bettery-action as well if you're using a laptop).

  2. Save the following script to a convenient location:

    #!/bin/bash
    cinnamon-screensaver-command -l
    systemctl suspend
    
  3. Use the System Settings app to create a custom keybinding for the sleep key that points to the script.

After this it behaves as it should. You can see the lock screen pop up briefly before it goes to sleep, which is reassuring.

1

It turns out the key is that it is a screensaver "problem", nothing to do with power management, suspend or resume!

So, go to Screensaver preferences, then the advanced tab. In the bottom-right is "Fading and Colormaps". Uncheck "Fade to Black when Blanking".

(I also have Grab Desktop Images unchecked, though I personally use the "Blank Screen Only" screensaver, so that is academic.)

This solution works equally well with lid-closing or using pm-suspend or using the suspend button from the power management menu; and equally well with opening the lid, or pressing the power button to resume. In a couple of my tests I did see the screen flash on briefly after a resume, when using power button to suspend and resume; one of those times it effectively crashed xfce, perhaps as I was testing too quickly. However using the lid-closing/lid-opening technique it has been always behaved correctly (so far).

  • It seems to work for me too ! – thethakuri Dec 20 '16 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.