Hacker News new | ask | show | jobs
by als0 2447 days ago
While on the subject, on Linux I've also noticed that Xscreensaver (or GNOME screensaver, can't remember which) sometimes goes straight into the desktop after wakeup for a few seconds before the lock screen prompt actually appears. You can even run programs. Really bizarre and feels like this issue has been present for a while now. Has anyone else noticed this or is it just me?
7 comments

I think this is because xscreensaver confines (grabs) the mouse cursor to the area occupied by the "Please enter your password" window. If this area somehow suddenly happens to be out of your screen boundaries (e.g. when xrandr --offing external screens), the mouse is ungrabbed and can be used to interact with the desktop. It takes a while before xscreensaver notices and grabs it again. Someone should probably figure out the exact steps to reproduce this and report it.

As said elsewhere, locking X is really hard, and xscreensaver architecture doesn't help. This week I managed to crash xscreensaver login prompt twice, unlocking the desktop without entering my password, and that was the last straw, I switched to xsecurelock which separates the login entry into another process, making such bugs much less severe.

Unfortunately I can't reliably reproduce the crash. A hardware fuzzer (also known as a faulty ThinkPad keyboard) was involved, and I don't possess the device any more. I think what it did was press certain keys very often ­— the keyboard matrix is sampled at 125 Hz, so I'm guessing it was pressing the keys about 60 times per second, but I'm not sure which keys they were. If anyone manages to reproduce this, please do give me a shout. :-)

Yeah, saw this the other day on an Ubuntu machine (running whatever the last release was, not LTS) I have hooked up to a TV. Flash of the desktop for a second or so before the login screen. Speaks to something fundamentally wrong with the way the whole thing works, I figure.
I had the same impression. That general feeling that the screensaver is like an app/overlay that is invoked only once the desktop is active. The speed of invocation also seemed related to how fast your machine is at launching general desktop programs...
>That general feeling that the screensaver is like an app/overlay that is invoked only once the desktop is active

That is how it is implemented (in X11)

It's REALLY important to distinguish between Xscreensaver and GNOME screensaver.

Warning: copy-paste this link, if jwz sees an HN referrer, you won't be happy.

www.jwz.org/blog/2015/04/i-told-you-so-again/

I run the real xscreensaver though (I was building it from the source until around this time last year, now I run the one from alpine but I don’t think they’ve done anything weird (I haven’t checked though))

I’m pretty sure I’ve seen what everyone is talking about and it’s bothered me a little too (granted, my machine is configured in such an undiscoverable way that just opening an xterm window is obscure enough to be nearly equivalent to a very short pin, and then you need to know bash. Now that I’m not in college and don’t have anything important that’s probably good enough even without xcreensaver.)

Computers were a mistake.
Indeed. I recommend a Butlerian Jihad followed by rigorous reliance on Mentats.

It's a joke but sometimes I really do wonder.

X locking is notoriously difficult.
I run xlock on suspend rather than on resume, seems more reliable. I'm any case, locking is trivial to bypass by pressing Control-C a few times on resume to kill xorg, hence why I also start X with "startx; exit" so that this drops to the login prompt instead of the shell.
I think this still isn't secure. Try "sleep 5; exit" and press C-Z. You won't be logged out. You probably want to use "exec startx" instead.
Thank you, I took a look at my shell man page and this is very helpful.
I'm interested to understand why. Is it because of the design of Xorg?
Yes, it's one of the reasons Wayland was created. Screensavers didn't exist when X was designed. https://www.phoronix.com/scan.php?page=news_item&px=OTI5MQ

> Right now with screensavers under X it's basically capturing the input and continually redrawing over the display. > With Wayland, Kristian plans for the lock-screen to be part of the Wayland compositor. In having the compositor handle the screensaver role, it can ensure that no window can appear atop the screensaver surface, it can properly detect idling and grabs already, and has complete control over the screen. Unlike the X design, there wouldn't even need to be a screensaver "window" that's on top but the compositor could just keep painting a black screen. For those interested in a "fancy screensaver", a plug-in could be used or an out-of-process Wayland client for drawing whatever you desire.

for the record I used to be able to see a bit of the desktop on windows after waking from sleep before the lock screen came on. can't remember if that's still true, though.
Ah yes, I remember that happening on windows xp a lot when it was waking up or between screensaver and login timeout (when they overlap), you'd even get the transition-to-welcome-screen sound so you know it only just triggered the locking just then. I suspect if you are fast you can run something before it actually locks.
That bug has been open for 6 years or more.