X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=b989e8a8f7fdbd619603500f77876b535af6c7af;hp=b3a389d6811ef993904252ed38502d531adfcf70;hb=c53b29e60b1fcc0f7f095eaabccf38b3630e28fa;hpb=9e8dd3479da9f484c9aa37adcd327989149e89ef diff --git a/dwm.c b/dwm.c index b3a389d..b989e8a 100644 --- a/dwm.c +++ b/dwm.c @@ -41,6 +41,7 @@ #endif /* XINERAMA */ /* macros */ +#define D if(1) #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH)) @@ -814,8 +815,8 @@ void focus(Client *c) { if(!c || !ISVISIBLE(c)) for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - if(selmon->sel) - unfocus(selmon->sel); +/* if(selmon->sel) + unfocus(selmon->sel);*/ if(c) { if(c->mon != selmon) selmon = c->mon; @@ -1388,12 +1389,27 @@ restack(Monitor *m) { void run(void) { XEvent ev; - + static const char *evname[LASTEvent] = { + [ButtonPress] = "buttonpress", + [ConfigureRequest] = "configurerequest", + [ConfigureNotify] = "configurenotify", + [DestroyNotify] = "destroynotify", + [EnterNotify] = "enternotify", + [Expose] = "expose", + [FocusIn] = "focusin", + [KeyPress] = "keypress", + [MappingNotify] = "mappingnotify", + [MapRequest] = "maprequest", + [PropertyNotify] = "propertynotify", + [UnmapNotify] = "unmapnotify" + }; /* main event loop */ XSync(dpy, False); - while(running && !XNextEvent(dpy, &ev)) + while(running && !XNextEvent(dpy, &ev)) { + D fprintf(stderr, "run event %s\n", evname[ev.type]); if(handler[ev.type]) handler[ev.type](&ev); /* call handler */ + } } void @@ -1449,10 +1465,9 @@ void setlayout(const Arg *arg) { if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) selmon->sellt ^= 1; - if(arg && arg->v) { + if(arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - } + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); if(selmon->sel) arrange(selmon); else