sowm: move tiny tiny functions to macros.

This commit is contained in:
Dylan Araps 2019-10-17 18:10:22 +03:00
parent 1248c93bcd
commit 0ae4e7918f
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 6 additions and 16 deletions

22
sowm.c
View File

@ -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;