Use the XComposite extension to get the composite overlay window,
instead of just using the normal root window. This ensures that
composited windows are covered.
Display "locking…" message when grabbing the pointer/keyboard,
after at least 250 ms of unfruitful attempts. If grabbing
eventually fails, application will not fork and return 1.
We need to ensure that the window handle is valid, i. e. the window is
actually created and accessible, before returning.
This is necessary because we immediately fork after returning, and the
child process opens its own X11 connection and expects the window handle
to be valid.
Fixes#46
As described in ticket #1114, the screen may be left turned off on successful
authentication. This commit fixes this behaviour by turning the screen back on
after the authentication.
Fixes#1114
Thanks to Ran Benita and Daniel Stone (the libxkbcommon authors) for
answering my questions and reviewing this code.
With this commit, input handling should be more correct with using less
code (in i3lock, that is).
Before this commit, the background color (white by default) was visible for
about 100ms until the image was drawn. This flickering is now eliminated.
Also, we don’t need to handle Expose-events anymore, as X11 will use the
window’s background pixmap automatically.
As explained in Jamey’s post on the XCB mailing list, the event
loop can/should be written in a more simple way than it was before
in xcb-event. See:
<AANLkTinhIM320wUjSeHkBTVk4ysBuiSZkvfs8pMLVykO@mail.gmail.com>
or
http://lists.freedesktop.org/archives/xcb/2010-July/006292.html