summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick <devnull@mailinator.com>2015-10-14 16:55:09 +0800
committerPatrick <devnull@mailinator.com>2015-10-14 16:55:09 +0800
commite1120cf4e2b0ad11c8244d4b5de03bf95682ad19 (patch)
tree48017867f27a2e8aa9360b9cc46b1d99fe5d858d
parent0a5b73a279fd31b6100220662299d4a66a6ee23b (diff)
make argc handling less obnoxious, let enum do its thing
-rw-r--r--x-alt-tab.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/x-alt-tab.c b/x-alt-tab.c
index e13d435..a979177 100644
--- a/x-alt-tab.c
+++ b/x-alt-tab.c
@@ -12,7 +12,7 @@ If not, see http://creativecommons.org/publicdomain/zero/1.0/ */
#include <X11/Xutil.h>
// Which way do we want to rotate the window stack?
-typedef enum RotationEnum { bottom_to_top = 0, top_to_bottom = 1 } Rotation;
+typedef enum RotationEnum { bottom_to_top, top_to_bottom } Rotation;
void x_alt_tab(Rotation r, Display *dpy, Window *wins, unsigned int nwins) {
XWindowAttributes attr;
@@ -55,7 +55,7 @@ int main(int argc, char **argv) {
if (nwins <= 1)
return 0;
- r = argc % 2 ? top_to_bottom : bottom_to_top;
+ r = (argc == 1) ? bottom_to_top : top_to_bottom;
x_alt_tab(r, dpy, wins, nwins);
return 0;
}