diff --git a/CMakeLists.txt b/CMakeLists.txt index 03a5ab5..4a9ee8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ set(CMAKE_C_FLAGS ${CFLAGS}) set(LIBRARIES_TO_LINK X11 confuse) + target_link_libraries(wmfs ${LIBRARIES_TO_LINK}) # Messages diff --git a/event.c b/event.c index 282245b..f11c9fe 100644 --- a/event.c +++ b/event.c @@ -78,7 +78,7 @@ buttonpress(XEvent ev) { for(i = 0; i < conf.ntag + 1; ++i) { - if(ev.xbutton.x > taglen[i-1] + if(ev.xbutton.x > taglen[i-1] - 3 && ev.xbutton.x < taglen[i]) { ITOA(s, i); @@ -99,7 +99,7 @@ buttonpress(XEvent ev) /* layout switch */ if(ev.xbutton.x >= taglen[conf.ntag] - 3 && ev.xbutton.x < taglen[conf.ntag] + - (strlen((getlayoutsym(layout[seltag])))*fonty+3)-3) + (strlen((getlayoutsym(layout[seltag])))*fonty+3) - 3) { if(ev.xbutton.button == Button1 || ev.xbutton.button == Button4) diff --git a/wmfs.c b/wmfs.c index 13abfb5..b31138f 100644 --- a/wmfs.c +++ b/wmfs.c @@ -43,7 +43,7 @@ arrange(void) else hide(c); - focus(selbytag[seltag]); + focus(NULL); layoutfunc[seltag](); } @@ -116,7 +116,6 @@ focus(Client *c) grabbuttons(c, True); sel = c; - selbytag[seltag] = c; if(c) { @@ -128,6 +127,8 @@ focus(Client *c) XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); updatetitle(c); } + else + XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); return; } @@ -900,8 +901,6 @@ tag(char *cmd) return; seltag = tmp; } - if(selbytag[seltag]) - focus(selbytag[seltag]); arrange(); return; @@ -1054,9 +1053,11 @@ unhide(Client *c) void unmanage(Client *c) { + if(ishide(c)) + return; + XSetErrorHandler(errorhandlerdummy); sel = (sel == c) ? c->next : NULL; - selbytag[seltag] = (selbytag[seltag] == c) ? c->next : NULL; if(conf.ttbarheight) { XUnmapWindow(dpy, c->tbar); @@ -1139,7 +1140,6 @@ updatebar(void) } - /* if c is 0, you can execute this function for the first time * else the button is just updated */ void diff --git a/wmfs.h b/wmfs.h index f9ecbf8..43e5288 100644 --- a/wmfs.h +++ b/wmfs.h @@ -265,7 +265,7 @@ Window bar; int screen; int mw, mh; Conf conf; -Key keys[512]; +Key keys[1024]; /* Atoms / Cursors */ Atom wm_atom[WMLast]; @@ -286,7 +286,6 @@ int taglen[MAXTAG]; /* Important Client */ Client *clients; Client *sel; -Client *selbytag[MAXTAG]; /* Layout/Tile Important variables */ float mwfact[MAXTAG];