Skip to content
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

Annoying error message when locking screen #257

Open
tsujan opened this issue May 30, 2020 · 32 comments
Open

Annoying error message when locking screen #257

tsujan opened this issue May 30, 2020 · 32 comments
Labels

Comments

@tsujan
Copy link
Member

tsujan commented May 30, 2020

Expected Behavior

When the screen is locked correctly, no error message should be shown.

Current Behavior

An error message is shown with xscreensaver after unlocking the screen.

Possible Solution

Do we lock the screen twice?!

Steps to Reproduce (for bugs)
  1. Install xscreensaver and start it.
  2. Check LXQt Session Settings → Basic Settings → Lock screen before suspending/hibernating.
  3. Log out and log in.
  4. Close the lid of your laptop to suspend it (or suspend it in any way).
  5. Open the lid (= resume). The system will be resumed and you could unlock the screen.

Then, after unlocking the screen, you'll see this dialog:

xscreensaver_error

This is redundant because the screen was locked and unlocked correctly.

Context

See lxqt/lxqt#1803 (comment)

System Information
  • Distribution & Version:
  • Kernel:
  • Qt Version:
  • libqtxdg Version:
  • lxqt-build-tools Version:
  • Package version:
@tsujan tsujan added the bug label May 30, 2020
@tsujan
Copy link
Member Author

tsujan commented May 30, 2020

@selairi, @yan12125, do you know why this happens?

@yan12125
Copy link
Member

yan12125 commented May 31, 2020

I follow your Steps to Reproduce and do not get the Screen Saver Error dialog after unlocking the screen.

If I lock the screen (not suspend) and run DISPLAY=:0 xscreensaver-command -lock from another tty, that command fails with "already locked" or "no response to command". So, a wild guess is that some other daemon has locked the screen and thus lxqt fails to lock it again.

@kmiernik
Copy link

Maybe this will help, but notice that it happens only with xscreensaver 5.44. WIth previous versions it is not. Secondly it happens only when suspend is called, try systemctl suspend, and simply unlock the screen.

@yan12125
Copy link
Member

I have xscreensaver 5.44, and I've tried using systemctl suspend as well as suspending from lxqt-leave, and got no error messages in either cases. By the way I also use Arch :)

@tsujan
Copy link
Member Author

tsujan commented May 31, 2020

So, the problem isn't as clear as it seemed to me and @kmiernik. There should be a hidden parameter somewhere — maybe, in xscreensaver.

I also have xscreensaver 5.42 and 5.43 in /var/cache/pacman/pkg; will test with them later.

@tsujan tsujan added question and removed bug labels May 31, 2020
@kmiernik
Copy link

My next guess for culprit is gdm. If I switch to lxdm I have no error message anymore. Perhaps it is locking the screen before the lxqt.

@tsujan
Copy link
Member Author

tsujan commented May 31, 2020

My next guess for culprit is gdm.

I use sddm.

@yan12125
Copy link
Member

yan12125 commented May 31, 2020 via email

@tsujan
Copy link
Member Author

tsujan commented May 31, 2020

On the computer I did tests, I have gdm too but it's disabled (I needed gdm to install gnome, in order to test some Qt apps under it).

I don't want to install xscreensaver on my main laptop (I'm working under its LXQt session) and can't uninstall gdm on my (older) test laptop (I need its gnome for tests). But I think, sooner or later, we'll find the cause and, most probably, it won't be in LXQt.

@yan12125
Copy link
Member

yan12125 commented May 31, 2020

Ah, found something interesting in xscreensaver

X11: On systemd systems, closing your laptop lid might actually lock your screen now, maybe.

(From changelog for version 5.43 on https://www.jwz.org/xscreensaver/changelog.html)

So I tried it - if I uncheck "Lock screen before suspending/hibernating", the screen is still locked after resuming from suspend.

Under the hood, a process xscreensaver-systemd listens to PrepareForSleep signal from systemd-logind (or maybe elogind or similar), and locks the screen. So, "some other daemon" might be xscreensaver itself :)

That also explains why the issue did not exist for older xscreensaver versions - systemd integration is new in xscreensaver 5.43.

@tsujan
Copy link
Member Author

tsujan commented May 31, 2020

It makes perfect sense.

Then, I guess we don't need to do anything. If new versions of xscreensaver don't need our option, the error message shows the user that he/she should either disable xscreensaver's mechanism or, more easily, uncheck LXQt's option.

@yan12125, if you agree on that, then this issue could be closed.

@tsujan
Copy link
Member Author

tsujan commented May 31, 2020

Perhaps, we could change the message to something like this:

Failed to run "xdg-screensaver lock". The reason may be that you do not have a locker/screensaver compatible with xdg-screensaver installed and running or the locking is done independently of LXQt.

@yan12125
Copy link
Member

yan12125 commented Jun 1, 2020

Agreed - changing the message is the only thing LXQt needs to do.

Although I believe xscreensaver is the cause, @kmiernik, can you confirm that?

@tsujan
Copy link
Member Author

tsujan commented Jun 1, 2020

@yan12125
I think @kmiernik has already confirmed it in #257 (comment) but I'll also test it today.

The display manager may only affect timing: If LXQt locks the screen first, the error message won't show up.

@kmiernik
Copy link

kmiernik commented Jun 1, 2020

I confirm that unchecking "Lock screen before suspending/hibernating" (I had hard time finding it) clears the problem. And yes, It looks like there is a race condition depending on display manager, with gdm I have the message each time, with lxdm it is like 1 in 10 tries.
Unfortunately "closing your laptop lid might actually lock your screen now, maybe" is accurate. It happens sometimes but not always.

@yan12125
Copy link
Member

yan12125 commented Jun 4, 2020

I confirm that unchecking "Lock screen before suspending/hibernating" (I had hard time finding it) clears the problem.

Thanks for testing! The option is in lxqt-config-session as the functionality is done by lxqt-session [1]. Maybe it should be migrated to lxqt-powermanagement, or even be split out to a new, standalone daemon. That should improve the overall stability in LXQt as bugs like lxqt/lxqt#1803 will not crash the whole session.

It happens sometimes but not always.

Sorry to hear that. As lxqt-session uses an approach similar to xscreensaver (lock the screen when the PrepareForSleep signal from systemd-logind is received), it might be unreliable, too. If you want to test if the lock before suspend feature in lxqt-session is reliable or not, you can rebuild xscreensaver using --without-systemd and re-enable the option in lxqt-config-session.

If LXQt cannot lock before suspend reliably either, a possible solution might be adding a new action like "lock screen and then suspend" and let lxqt-powermanagement to run that action when the lid is closed.

[1] https://github.com/lxqt/lxqt-session/blob/master/lxqt-session/src/lockscreenmanager.cpp

@tsujan
Copy link
Member Author

tsujan commented Jun 4, 2020

That should improve the overall stability in LXQt as bugs like lxqt/lxqt#1803 will not crash the whole session.

Very good idea!

@kmiernik
Copy link

kmiernik commented Jun 6, 2020

For a past two days I have been using suggested configuration with xscreensaver compiled --without-systemd along with lxqt-session suspend option. It looks like it works without problems.

From a user perspective having all blank/lock/suspend options in one place and govern by one daemon seems like a reasonable simplification and it would be easier to set the expected behavior.

@yan12125
Copy link
Member

yan12125 commented Jun 6, 2020

Thanks for testing! Then the only thing to change in LXQt is the error message in the dialog.

@tsujan
Copy link
Member Author

tsujan commented Jun 6, 2020

Then the only thing to change in LXQt is the error message in the dialog.

I agree — for this issue to be closed. Later, we'll really need to put those settings elsewhere, so that lxqt-session will be immune to bugs from other codes, as you proposed above.

@yan12125
Copy link
Member

yan12125 commented Jun 7, 2020

Later, we'll really need to put those settings elsewhere, so that lxqt-session will be immune to bugs from other codes, as you proposed above.

I created lxqt/lxqt#1806 for tracking those.

@ghost
Copy link

ghost commented Jun 18, 2022

Expected Behavior

When the screen is locked correctly, no error message should be shown.

Current Behavior

An error message is shown with xscreensaver after unlocking the screen.

Possible Solution

Do we lock the screen twice?!

Steps to Reproduce (for bugs)
  1. Install xscreensaver and start it.
  2. Check LXQt Session Settings → Basic Settings → Lock screen before suspending/hibernating.
  3. Log out and log in.
  4. Close the lid of your laptop to suspend it (or suspend it in any way).
  5. Open the lid (= resume). The system will be resumed and you could unlock the screen.

Then, after unlocking the screen, you'll see this dialog:

xscreensaver_error

This is redundant because the screen was locked and unlocked correctly.

Context

See lxqt/lxqt#1803 (comment)

System Information
  • Distribution & Version:
  • Kernel:
  • Qt Version:
  • libqtxdg Version:
  • lxqt-build-tools Version:
  • Package version:
Expected Behavior

When the screen is locked correctly, no error message should be shown.

Current Behavior

An error message is shown with xscreensaver after unlocking the screen.

Possible Solution

Do we lock the screen twice?!

Steps to Reproduce (for bugs)
  1. Install xscreensaver and start it.
  2. Check LXQt Session Settings → Basic Settings → Lock screen before suspending/hibernating.
  3. Log out and log in.
  4. Close the lid of your laptop to suspend it (or suspend it in any way).
  5. Open the lid (= resume). The system will be resumed and you could unlock the screen.

Then, after unlocking the screen, you'll see this dialog:

xscreensaver_error

This is redundant because the screen was locked and unlocked correctly.

Context

See lxqt/lxqt#1803 (comment)

System Information
  • Distribution & Version:
  • Kernel:
  • Qt Version:
  • libqtxdg Version:
  • lxqt-build-tools Version:
  • Package version:

Just Install sscreensaver
Im in arch
So
pacman -S xscreensaver
reboot
you will be fine now

@eddmax
Copy link

eddmax commented Dec 27, 2023

@tsujan chabuduo development ... you people are for LOLZ - bug still exist as well now..

@DebianUser007
Copy link

still exist as well now

@jhfhngj
Copy link

jhfhngj commented May 1, 2024

Same, happens with Lubuntu.

@stefonarch
Copy link
Member

Same, happens with Lubuntu.

I've a default installation of Lubuntu 24.04 in Vbox with xscreensaver installed and cannot reproduce this.

@AengusBl
Copy link

Same, happens with Lubuntu.

I am also on Lubuntu and the issue is reproducible every time I suspend the system.

@stefonarch
Copy link
Member

Same, happens with Lubuntu.

I am also on Lubuntu and the issue is reproducible every time I suspend the system.

As I can't reproduce: could you try using this locking method instead of xscreensaver?

@mmortal03
Copy link

mmortal03 commented Jul 11, 2024

I just installed Debian 12.6 with LXQt and lightdm, but this was a very custom, barebones install, probably too barebones. None of xscreensaver, xdg-utils, or light-locker were installed. This being the case, I was getting this error when locking or suspending the machine. So, I tried installing xscreensaver and xdg-utils. (I believe I logged out and/or restarted after doing this, but I can't remember for sure.) This did not fix the problem. Then I tried installing light-locker, and this fixed the problem, but xscreensaver was telling me that the two interfere with each other, so I next uninstalled xscreensaver, and now this is fixed. Weird bug because I have a different machine that is up to date, with xscreensaver and xdg-utils installed, but not light-locker, and I can't reproduce the bug there.

@AengusBl
Copy link

AengusBl commented Jul 13, 2024

Same, happens with Lubuntu.

I am also on Lubuntu and the issue is reproducible every time I suspend the system.

As I can't reproduce: could you try using this locking method instead of xscreensaver?

As @kmiernik pointed out, the solution is to go to the LXQt settings and untick "Lock screen before suspending/hibernating". Here is the exact path to access this on Lubuntu:

  1. Lubuntu icon at the bottom left-hand corner of the screen;
  2. Preferences;
  3. LXQt Settings;
  4. Session Settings;
  5. Basic Settings;
  6. Under "Leave Session", untick "Lock screen before suspending/hibernating".

@Vistaus
Copy link
Contributor

Vistaus commented Oct 17, 2024

I too run into this issue and the solution by @AengusBl does not work, at least not on Arch.

@AengusBl
Copy link

I wrote that comment because that's what fixed the issue for me on Lubuntu. I guess Arch is too different or you have a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants