mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-05-19 09:30:24 -07:00
sowm: move tiny tiny functions to macros.
This commit is contained in:
parent
1248c93bcd
commit
0ae4e7918f
20
sowm.c
20
sowm.c
@ -48,8 +48,6 @@ static void win_kill();
|
|||||||
static void win_next();
|
static void win_next();
|
||||||
static void win_to_ws(const Arg arg);
|
static void win_to_ws(const Arg arg);
|
||||||
static void ws_go(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 int xerror() { return 0;}
|
||||||
|
|
||||||
static client *list = {0};
|
static client *list = {0};
|
||||||
@ -75,12 +73,13 @@ static void (*events[LASTEvent])(XEvent *e) = {
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define win (client *c=list;c;c=c->next)
|
#define win (client *c=list;c;c=c->next)
|
||||||
|
#define win_focus(W) XSetInputFocus(d, W, RevertToParent, CurrentTime)
|
||||||
#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) \
|
#define win_size(W, gx, gy, gw, gh) \
|
||||||
XGetGeometry(d, W, &(Window){0}, 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() {
|
Window win_current() {
|
||||||
XGetInputFocus(d, &cur, (int[]){1});
|
XGetInputFocus(d, &cur, (int[]){1});
|
||||||
@ -96,7 +95,7 @@ void notify_destroy(XEvent *e) {
|
|||||||
void notify_enter(XEvent *e) {
|
void notify_enter(XEvent *e) {
|
||||||
while(XCheckTypedEvent(d, EnterNotify, e));
|
while(XCheckTypedEvent(d, EnterNotify, e));
|
||||||
|
|
||||||
win_focus(e->xcrossing.window)
|
win_focus(e->xcrossing.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_motion(XEvent *e) {
|
void notify_motion(XEvent *e) {
|
||||||
@ -260,15 +259,6 @@ void ws_go(const Arg arg) {
|
|||||||
if (list) win_focus(list->w);
|
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) {
|
void configure_request(XEvent *e) {
|
||||||
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
XConfigureRequestEvent *ev = &e->xconfigurerequest;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user