From 0ae4e7918f199adf0473c9c44f60bcd44bb8ba16 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 17 Oct 2019 18:10:22 +0300 Subject: [PATCH] sowm: move tiny tiny functions to macros. --- sowm.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sowm.c b/sowm.c index 588763c..67aa05b 100644 --- a/sowm.c +++ b/sowm.c @@ -48,8 +48,6 @@ static void win_kill(); static void win_next(); static void win_to_ws(const Arg arg); static void ws_go(const Arg arg); -static void ws_save(int i); -static void ws_sel(int i); static int xerror() { return 0;} static client *list = {0}; @@ -74,13 +72,14 @@ static void (*events[LASTEvent])(XEvent *e) = { #include "config.h" -#define win (client *c=list;c;c=c->next) - -#define win_focus(W) XSetInputFocus(d, W, RevertToParent, CurrentTime); +#define win (client *c=list;c;c=c->next) +#define win_focus(W) XSetInputFocus(d, W, RevertToParent, CurrentTime) +#define ws_save(W) ws_list[W].list = list +#define ws_sel(W) list = ws_list[ws = W].list #define win_size(W, gx, gy, gw, gh) \ XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ - &(unsigned int){0}, &(unsigned int){0}); + &(unsigned int){0}, &(unsigned int){0}) Window win_current() { XGetInputFocus(d, &cur, (int[]){1}); @@ -96,7 +95,7 @@ void notify_destroy(XEvent *e) { void notify_enter(XEvent *e) { while(XCheckTypedEvent(d, EnterNotify, e)); - win_focus(e->xcrossing.window) + win_focus(e->xcrossing.window); } void notify_motion(XEvent *e) { @@ -260,15 +259,6 @@ void ws_go(const Arg arg) { if (list) win_focus(list->w); } -void ws_save(int i) { - ws_list[i].list = list; -} - -void ws_sel(int i) { - list = ws_list[i].list; - ws = i; -} - void configure_request(XEvent *e) { XConfigureRequestEvent *ev = &e->xconfigurerequest;