mirror of
https://github.com/dylanaraps/sowm.git
synced 2025-07-26 09:41:59 -07:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
6b8a169b9d | ||
|
f201a467ea |
2
Makefile
2
Makefile
@@ -10,7 +10,7 @@ config.h:
|
|||||||
cp config.def.h config.h
|
cp config.def.h config.h
|
||||||
|
|
||||||
sowm:
|
sowm:
|
||||||
$(CC) -O3 $(CFLAGS) -lX11 $(LDFLAGS) -o sowm sowm.c
|
$(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS)
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
|
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
|
||||||
|
15
sowm.c
15
sowm.c
@@ -255,6 +255,20 @@ void input_grab(Window root) {
|
|||||||
XFreeModifiermap(modmap);
|
XFreeModifiermap(modmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void win_init(void) {
|
||||||
|
Window *child;
|
||||||
|
unsigned int i, n_child;
|
||||||
|
|
||||||
|
XQueryTree(d, RootWindow(d, DefaultScreen(d)),
|
||||||
|
&(Window){0}, &(Window){0}, &child, &n_child);
|
||||||
|
|
||||||
|
for (i = 0; i < n_child; i++) {
|
||||||
|
XSelectInput(d, child[i], StructureNotifyMask|EnterWindowMask);
|
||||||
|
XMapWindow(d, child[i]);
|
||||||
|
win_add(child[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
|
|
||||||
@@ -271,6 +285,7 @@ int main(void) {
|
|||||||
XSelectInput(d, root, SubstructureRedirectMask);
|
XSelectInput(d, root, SubstructureRedirectMask);
|
||||||
XDefineCursor(d, root, XCreateFontCursor(d, 68));
|
XDefineCursor(d, root, XCreateFontCursor(d, 68));
|
||||||
input_grab(root);
|
input_grab(root);
|
||||||
|
win_init();
|
||||||
|
|
||||||
while (1 && !XNextEvent(d, &ev))
|
while (1 && !XNextEvent(d, &ev))
|
||||||
if (events[ev.type]) events[ev.type](&ev);
|
if (events[ev.type]) events[ev.type](&ev);
|
||||||
|
1
sowm.h
1
sowm.h
@@ -51,6 +51,7 @@ void win_focus(client *c);
|
|||||||
void win_kill(const Arg arg);
|
void win_kill(const Arg arg);
|
||||||
void win_prev(const Arg arg);
|
void win_prev(const Arg arg);
|
||||||
void win_next(const Arg arg);
|
void win_next(const Arg arg);
|
||||||
|
void win_init(void);
|
||||||
void win_to_ws(const Arg arg);
|
void win_to_ws(const Arg arg);
|
||||||
void ws_go(const Arg arg);
|
void ws_go(const Arg arg);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user