diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3da8ac9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +catwm +*.o diff --git a/Makefile b/Makefile index 95a7065..2562f54 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CFLAGS+= -Wall -LDADD+= -lX11 +LDADD+= -lX11 LDFLAGS= EXEC=catwm @@ -17,4 +17,4 @@ install: all install -Dm 755 catwm $(DESTDIR)$(BINDIR)/catwm clean: - rm -f catwm *.o + rm -f $(EXEC) *.o diff --git a/catwm.c b/catwm.c index 87dbe53..2ead449 100755 --- a/catwm.c +++ b/catwm.c @@ -30,6 +30,7 @@ */ #include +#include #include #include #include @@ -191,7 +192,7 @@ void change_desktop(const Arg arg) { void client_to_desktop(const Arg arg) { client *tmp = current; int tmp2 = current_desktop; - + if(arg.i == current_desktop || current == NULL) return; @@ -242,7 +243,7 @@ void destroynotify(XEvent *e) { for(c=head;c;c=c->next) if(ev->window == c->win) i++; - + // End of the hack if(i == 0) return; @@ -289,7 +290,7 @@ void increase() { void keypress(XEvent *e) { int i; XKeyEvent ke = e->xkey; - KeySym keysym = XKeycodeToKeysym(dis,ke.keycode,0); + KeySym keysym = XkbKeycodeToKeysym(dis,ke.keycode,0,0); for(i=0;iwin); } } - + void maprequest(XEvent *e) { XMapRequestEvent *ev = &e->xmaprequest; @@ -411,7 +412,7 @@ void quit() { Window root_return, parent; Window *children; int i; - unsigned int nchildren; + unsigned int nchildren; XEvent ev; /* @@ -496,7 +497,7 @@ void select_desktop(int i) { current_desktop = i; } -void send_kill_signal(Window w) { +void send_kill_signal(Window w) { XEvent ke; ke.type = ClientMessage; ke.xclient.window = w; @@ -552,7 +553,7 @@ void setup() { const Arg arg = {.i = 1}; current_desktop = arg.i; change_desktop(arg); - + // To catch maprequest and destroynotify (if other wm running) XSelectInput(dis,root,SubstructureNotifyMask|SubstructureRedirectMask); } @@ -656,7 +657,7 @@ void update_current() { } int main(int argc, char **argv) { - // Open display + // Open display if(!(dis = XOpenDisplay(NULL))) die("Cannot open display!");