2 Commits
1.5 ... watch

Author SHA1 Message Date
Dylan Araps
6b8a169b9d sowm: Add existing clients 2020-03-08 12:39:45 +02:00
Dylan Araps
f201a467ea sowm: Fix linker errors. Closes #61 2020-02-21 18:08:47 +02:00
3 changed files with 17 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ config.h:
cp config.def.h config.h
sowm:
$(CC) -O3 $(CFLAGS) -lX11 $(LDFLAGS) -o sowm sowm.c
$(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS)
install: all
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm

15
sowm.c
View File

@@ -255,6 +255,20 @@ void input_grab(Window root) {
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) {
XEvent ev;
@@ -271,6 +285,7 @@ int main(void) {
XSelectInput(d, root, SubstructureRedirectMask);
XDefineCursor(d, root, XCreateFontCursor(d, 68));
input_grab(root);
win_init();
while (1 && !XNextEvent(d, &ev))
if (events[ev.type]) events[ev.type](&ev);

1
sowm.h
View File

@@ -51,6 +51,7 @@ void win_focus(client *c);
void win_kill(const Arg arg);
void win_prev(const Arg arg);
void win_next(const Arg arg);
void win_init(void);
void win_to_ws(const Arg arg);
void ws_go(const Arg arg);