mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-08-17 13:13:56 -07:00
docs: update
This commit is contained in:
33
sowm.c
33
sowm.c
@@ -62,13 +62,10 @@ static void configure_request(XEvent *e);
|
|||||||
static void map_request(XEvent *e);
|
static void map_request(XEvent *e);
|
||||||
static void run(const Arg arg);
|
static void run(const Arg arg);
|
||||||
|
|
||||||
static void wm_init();
|
|
||||||
static void wm_setup();
|
|
||||||
|
|
||||||
static client *list = { 0 };
|
static client *list = { 0 };
|
||||||
static ws ws_list[10];
|
static ws ws_list[10];
|
||||||
|
|
||||||
static int desk = 1, sh, sw;
|
static int desk = 1, sh, sw, s;
|
||||||
|
|
||||||
static Display *dis;
|
static Display *dis;
|
||||||
static Window root;
|
static Window root;
|
||||||
@@ -336,13 +333,17 @@ void run(const Arg arg) {
|
|||||||
execvp((char*)arg.com[0], (char**)arg.com);
|
execvp((char*)arg.com[0], (char**)arg.com);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wm_setup() {
|
int main(void) {
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
if (!(dis = XOpenDisplay(0x0))) return 0;
|
||||||
|
|
||||||
signal(SIGCHLD, SIG_IGN);
|
signal(SIGCHLD, SIG_IGN);
|
||||||
|
|
||||||
int s = DefaultScreen(dis);
|
s = DefaultScreen(dis);
|
||||||
root = RootWindow(dis, s);
|
root = RootWindow(dis, s);
|
||||||
sw = XDisplayWidth(dis, s);
|
sw = XDisplayWidth(dis, s);
|
||||||
sh = XDisplayHeight(dis, s);
|
sh = XDisplayHeight(dis, s);
|
||||||
|
|
||||||
key_grab();
|
key_grab();
|
||||||
|
|
||||||
@@ -354,12 +355,6 @@ void wm_setup() {
|
|||||||
|
|
||||||
XSelectInput(dis, root, SubstructureNotifyMask|
|
XSelectInput(dis, root, SubstructureNotifyMask|
|
||||||
SubstructureRedirectMask|EnterWindowMask|LeaveWindowMask);
|
SubstructureRedirectMask|EnterWindowMask|LeaveWindowMask);
|
||||||
}
|
|
||||||
|
|
||||||
void wm_init() {
|
|
||||||
XEvent ev;
|
|
||||||
|
|
||||||
wm_setup();
|
|
||||||
|
|
||||||
XGrabButton(dis, 1, Mod4Mask, root, True,
|
XGrabButton(dis, 1, Mod4Mask, root, True,
|
||||||
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
||||||
@@ -369,14 +364,6 @@ void wm_init() {
|
|||||||
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
ButtonPressMask|ButtonReleaseMask|PointerMotionMask,
|
||||||
GrabModeAsync, GrabModeAsync, None, None);
|
GrabModeAsync, GrabModeAsync, None, None);
|
||||||
|
|
||||||
start.subwindow = None;
|
|
||||||
|
|
||||||
while(1 && !XNextEvent(dis, &ev))
|
while(1 && !XNextEvent(dis, &ev))
|
||||||
if (events[ev.type]) events[ev.type](&ev);
|
if (events[ev.type]) events[ev.type](&ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
if ((dis = XOpenDisplay(0))) wm_init();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user