From: FRIGN Date: Sun, 11 Sep 2016 21:08:19 +0000 (+0200) Subject: Remove cleanup and deglobalize and rework data structures X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=b00f444a4ea0d9ffa5cd7dcda71c97cdf05d322e;hp=b00f444a4ea0d9ffa5cd7dcda71c97cdf05d322e;p=slock.git 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. ---