X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=5df4919ec073579cfccfb4edd87402e186f6d938;hp=32755cb79a4df6755b79c2ab9d2140fe2729d7b3;hb=5c6545adf5e2fc7011bd53735910f66998cade64;hpb=210378f19833c739f3d2e4acaca55fccb29c57f7 diff --git a/dwm.c b/dwm.c index 32755cb..5df4919 100644 --- a/dwm.c +++ b/dwm.c @@ -57,7 +57,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ -enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ +enum { NetSupported, NetWMName, NetWMState, NetLast }; /* EWMH atoms */ enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ @@ -847,7 +847,8 @@ focusmon(const Arg *arg) { if(!mons->next) return; - m = dirtomon(arg->i); + if((m = dirtomon(arg->i)) == selmon) + return; unfocus(selmon->sel); selmon = m; focus(NULL); @@ -1388,12 +1389,12 @@ restack(Monitor *m) { void run(void) { XEvent ev; - /* main event loop */ XSync(dpy, False); - while(running && !XNextEvent(dpy, &ev)) + while(running && !XNextEvent(dpy, &ev)) { if(handler[ev.type]) handler[ev.type](&ev); /* call handler */ + } } void @@ -1493,6 +1494,7 @@ setup(void) { wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); + netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); /* init cursors */ cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); @@ -2001,7 +2003,7 @@ zoom(const Arg *arg) { int main(int argc, char *argv[]) { if(argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION", © 2006-2009 dwm engineers, see LICENSE for details\n"); + die("dwm-"VERSION", © 2006-2010 dwm engineers, see LICENSE for details\n"); else if(argc != 1) die("usage: dwm [-v]\n"); if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())