lahwaacz / sxlock

MIT License
41 stars 21 forks source link

sxlock is Circumventable #34

Open limitedAtonement opened 7 months ago

limitedAtonement commented 7 months ago

23 speaks about sxlock crashing, and this may be a duplicate. #27 has the same title as this, but they are different issues.

If I unplug the power supply from my laptop, I can press escape and unlock the screen without entering a password. Standard out or standard error outputs the following when that happens:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  147 (DPMS)
  Minor opcode of failed request:  6 (DPMSForceLevel)
  Serial number of failed request:  56
  Current serial number in output stream:  60

I spent some time debugging and it looks like the call: XNextEvent(dpy, &event) fails. Nothing runs after that point, the program exits like it received sigkill or something.

limitedAtonement commented 7 months ago

I added some logging to the signal handler, and I didn't see anything there.

limitedAtonement commented 7 months ago

It appears XNextEvent may be calling exit, but I can't tell why. Perhaps my dpy changed by changing power modes in such a way that querying for another event fails?