google / xsecurelock

X11 screen lock utility with security in mind

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: Send signal to savers when authenticator opens

PaulHaeger opened this issue · comments

commented

As a preliminary note: I already have figured out a way to do this, so minimal work is required. I'm putting this issue to find out whether there is interest in me preparing a pull request.

In order to allow for more interactivity and make it possible for a custom screensaver to emulate common behavior (e.g. the background image blurring when the prompt is active and unblurring if it isn't) there needs to be some kind of way for the saver processes to know whether the promt is active or not.

The variable XSECURELOCK_SAVER_RESET_ON_AUTH_CLOSE lets the saver be notified via a SIGUSR1 signal when the prompt disappears. So the only thing left is to send a signal to the saver when the prompt opens. Conveniently, SIGUSR2 is still unused. So I propose that a SIGUSR2 signal is sent to the saver children when the prompt is opened (when an extra option is set of course).

I currently implemented this by adding a KillAllSaverChildrenSigHandler(SIGUSR2); call in the want_auth part of int WatchChildren. To prevent the signal being sent every frame, I added a new boolean value that starts with false and is set to true when the signal has been sent once, preventing further signals from being sent. When its determined that the authenticator closed, then the boolean is set to false again.

What is left to do for a PR is:

  • Clean the changes up a bit and introduce a new configuration variable
  • Give other savers the ability to cope with SIGUSR2 as well (in the moment I only edited the multiplexer to not terminate)
  • Adapt the documentation

Is there interest in me creating a PR and is there any feedback in my approach?