mirror of
https://github.com/dylanaraps/sowm.git
synced 2026-11-06 15:50:51 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b8a169b9d | ||
|
|
f201a467ea | ||
|
|
7821aac0d2 | ||
|
|
a1c80d9b23 | ||
|
|
0df345e1da |
No files matched your search
@@ -9,8 +9,8 @@ all: config.h sowm
|
||||
config.h:
|
||||
cp config.def.h config.h
|
||||
|
||||
sowm: sowm.o
|
||||
$(CC) $(LDFLAGS) -O3 -o sowm sowm.c -lX11
|
||||
sowm:
|
||||
$(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS)
|
||||
|
||||
install: all
|
||||
install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user