]> git.armaanb.net Git - slock.git/commit
Remove cleanup and deglobalize and rework data structures
authorFRIGN <dev@frign.de>
Sun, 11 Sep 2016 21:08:19 +0000 (23:08 +0200)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Fri, 23 Sep 2016 16:39:01 +0000 (18:39 +0200)
commitb00f444a4ea0d9ffa5cd7dcda71c97cdf05d322e
tree70941ff297d2257a52621884f64af9cbfa364b52
parentcd3c546c37d91e24b8c55bab88bfcb920d8ea895
Remove cleanup and deglobalize and rework data structures

The cleanup removal is a joint-venture with Markus. We assume the X server does
the cleanup, so we don't need it. The idea is that the fds are closed at exit
and thus already indicate to the X server that the client has quit. Analogously
the same applies to freeing memory sections previously allocated for the X
server.

We love XXXXXL burgers and therefore removed
XUngrabPointer
XUngrabKeyboard
XFreeColors
XFreePixmap
XDestroyWindow
Lines of Code.

For a project like slock there is no need to carry around global state. By
moving the three structures to main() it is now clear which functions modify
which state, greatly improving the readability of the code, especially given
slock is a suid program.
slock.c