From 114cc3ec020ac81bdb16123f4d956d80a531d830 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Fri, 22 Sep 2006 16:35:49 +0200 Subject: [PATCH 01/16] applied Jukkas remark (dunno if this is correct though) --- view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view.c b/view.c index c5e942d..fd53dc8 100644 --- a/view.c +++ b/view.c @@ -112,12 +112,12 @@ dotile(Arg *arg) { for(i = 0, c = clients; c; c = c->next) { if(isvisible(c)) { - if(c->ismax) - togglemax(c); if(c->isfloat) { resize(c, True, TopLeft); continue; } + if(c->ismax) + togglemax(c); if(n == 1) { c->x = sx; c->y = sy + bh; -- 2.20.1 From cff951c65086950eeef5723b65dc06cbe7cdfa19 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Fri, 22 Sep 2006 18:48:35 +0200 Subject: [PATCH 02/16] removed all dotile checks --- draw.c | 2 +- view.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/draw.c b/draw.c index e8ee08d..65a3d51 100644 --- a/draw.c +++ b/draw.c @@ -104,7 +104,7 @@ drawstatus() { } dc.w = bmw; - drawtext(arrange == dotile ? TILESYMBOL : FLOATSYMBOL, dc.status, False); + drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, dc.status, False); x = dc.x + dc.w; dc.w = textw(stext); diff --git a/view.c b/view.c index fd53dc8..ab1924a 100644 --- a/view.c +++ b/view.c @@ -50,7 +50,7 @@ togglemax(Client *c) c->rx = c->x; c->x = sx; c->ry = c->y; c->y = bh; c->rw = c->w; c->w = sw; - c->rh = c->h; c->h = sh - bh; + c->rh = c->h; c->h = sh - bh - 2; } else { c->x = c->rx; @@ -208,7 +208,7 @@ resizecol(Arg *arg) { for(n = 0, c = clients; c; c = c->next) if(isvisible(c) && !c->isfloat) n++; - if(!sel || sel->isfloat || n < 2 || (arrange != dotile)) + if(!sel || sel->isfloat || n < 2 || (arrange == dofloat)) return; if(sel == getnext(clients)) { @@ -305,7 +305,7 @@ zoom(Arg *arg) { for(n = 0, c = clients; c; c = c->next) if(isvisible(c) && !c->isfloat) n++; - if(n < 2 || (arrange != dotile)) + if(n < 2 || (arrange == dofloat)) return; if((c = sel) == nexttiled(clients)) -- 2.20.1 From 6b25d06d7d159bf89d740847fedc876ab0137b6b Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Mon, 25 Sep 2006 08:21:51 +0200 Subject: [PATCH 03/16] applied Jukkas patch --- draw.c | 4 ++-- dwm.h | 12 ++++++------ event.c | 8 ++++---- main.c | 6 +++--- tag.c | 2 +- view.c | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/draw.c b/draw.c index 65a3d51..3fbac5b 100644 --- a/draw.c +++ b/draw.c @@ -80,7 +80,7 @@ drawtext(const char *text, unsigned long col[ColLast], Bool highlight) { /* extern */ void -drawall() { +drawall(void) { Client *c; for(c = clients; c; c = getnext(c->next)) @@ -89,7 +89,7 @@ drawall() { } void -drawstatus() { +drawstatus(void) { int i, x; dc.x = dc.y = 0; diff --git a/dwm.h b/dwm.h index 178aab8..e749f2c 100644 --- a/dwm.h +++ b/dwm.h @@ -121,16 +121,16 @@ extern void updatetitle(Client *c); /* update the name of c */ extern void unmanage(Client *c); /* destroy c */ /* draw.c */ -extern void drawall(); /* draw all visible client titles and the bar */ -extern void drawstatus(); /* draw the bar */ +extern void drawall(void); /* draw all visible client titles and the bar */ +extern void drawstatus(void); /* draw the bar */ extern void drawtitle(Client *c); /* draw title of c */ extern unsigned long getcolor(const char *colstr); /* return color of colstr */ extern void setfont(const char *fontstr); /* set the font for DC */ extern unsigned int textw(const char *text); /* return the width of text in px*/ /* event.c */ -extern void grabkeys(); /* grab all keys defined in config.h */ -extern void procevent(); /* process pending X events */ +extern void grabkeys(void); /* grab all keys defined in config.h */ +extern void procevent(void); /* process pending X events */ /* main.c */ extern int getproto(Window w); /* return protocol mask of WMProtocols property of w */ @@ -139,7 +139,7 @@ extern void sendevent(Window w, Atom a, long value); /* send synthetic event to extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ /* tag.c */ -extern void initrregs(); /* initialize regexps of rules defined in config.h */ +extern void initrregs(void); /* initialize regexps of rules defined in config.h */ extern Client *getnext(Client *c); /* returns next visible client */ extern Client *getprev(Client *c); /* returns previous visible client */ extern void settags(Client *c, Client *trans); /* sets tags of c */ @@ -160,7 +160,7 @@ extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */ extern Bool isvisible(Client *c); /* returns True if client is visible */ extern void resizecol(Arg *arg); /* resizes the master width with arg's index value */ -extern void restack(); /* restores z layers of all clients */ +extern void restack(void); /* restores z layers of all clients */ extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ extern void view(Arg *arg); /* views the tag with arg's index */ diff --git a/event.c b/event.c index 9f120d7..83301bc 100644 --- a/event.c +++ b/event.c @@ -170,13 +170,13 @@ buttonpress(XEvent *e) { if(CLEANMASK(ev->state) != MODKEY) return; if(ev->button == Button1 && (arrange == dofloat || c->isfloat)) { - restack(c); + restack(); movemouse(c); } else if(ev->button == Button2) zoom(NULL); else if(ev->button == Button3 && (arrange == dofloat || c->isfloat)) { - restack(c); + restack(); resizemouse(c); } } @@ -388,7 +388,7 @@ void (*handler[LASTEvent]) (XEvent *) = { }; void -grabkeys() { +grabkeys(void) { static unsigned int len = sizeof(key) / sizeof(key[0]); unsigned int i; KeyCode code; @@ -408,7 +408,7 @@ grabkeys() { } void -procevent() { +procevent(void) { XEvent ev; while(XPending(dpy)) { diff --git a/main.c b/main.c index b3c753e..7cd3a32 100644 --- a/main.c +++ b/main.c @@ -38,7 +38,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *); static Bool otherwm, readin; static void -cleanup() { +cleanup(void) { close(STDIN_FILENO); while(sel) { resize(sel, True, TopLeft); @@ -58,7 +58,7 @@ cleanup() { } static void -scan() { +scan(void) { unsigned int i, num; Window *wins, d1, d2; XWindowAttributes wa; @@ -79,7 +79,7 @@ scan() { } static void -setup() { +setup(void) { int i, j; unsigned int mask; Window w; diff --git a/tag.c b/tag.c index 962b484..eda1543 100644 --- a/tag.c +++ b/tag.c @@ -45,7 +45,7 @@ getprev(Client *c) { } void -initrregs() { +initrregs(void) { unsigned int i; regex_t *reg; diff --git a/view.c b/view.c index ab1924a..44c0b30 100644 --- a/view.c +++ b/view.c @@ -7,7 +7,7 @@ /* static */ static Client * -minclient() { +minclient(void) { Client *c, *min; if((clients && clients->isfloat) || arrange == dofloat) @@ -25,7 +25,7 @@ nexttiled(Client *c) { } static void -reorder() { +reorder(void) { Client *c, *newclients, *tail; newclients = tail = NULL; @@ -225,7 +225,7 @@ resizecol(Arg *arg) { } void -restack() { +restack(void) { Client *c; XEvent ev; -- 2.20.1 From 7d7cde0fd6ceae2f7d759b924afd8df279a4ddde Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Mon, 25 Sep 2006 20:38:30 +0200 Subject: [PATCH 04/16] applied sanders jukka patch --- dwm.h | 2 +- event.c | 6 +----- view.c | 8 +++----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/dwm.h b/dwm.h index e749f2c..c30f2b3 100644 --- a/dwm.h +++ b/dwm.h @@ -101,7 +101,7 @@ extern void (*handler[LASTEvent])(XEvent *); /* event handler */ extern void (*arrange)(Arg *); /* arrange function, indicates mode */ extern Atom wmatom[WMLast], netatom[NetLast]; extern Bool running, issel, *seltag; /* seltag is array of Bool */ -extern Client *clients, *sel, *stack; /* global cleint list and stack */ +extern Client *clients, *sel, *stack; /* global client list and stack */ extern Cursor cursor[CurLast]; extern DC dc; /* global draw context */ extern Display *dpy; diff --git a/event.c b/event.c index 83301bc..df0a5ef 100644 --- a/event.c +++ b/event.c @@ -190,11 +190,7 @@ configurerequest(XEvent *e) { XWindowChanges wc; if((c = getclient(ev->window))) { - if((c == sel) && !c->isfloat && (arrange != dofloat)) { - synconfig(c, sx, sy + bh, sw - 2, sh - 2 - bh, ev->border_width); - XSync(dpy, False); - return; - } + c->ismax = False; gravitate(c, True); if(ev->value_mask & CWX) c->x = ev->x; diff --git a/view.c b/view.c index 44c0b30..e799094 100644 --- a/view.c +++ b/view.c @@ -101,9 +101,8 @@ dotile(Arg *arg) { Client *c; w = sw - mw; - for(n = 0, c = clients; c; c = c->next) - if(isvisible(c) && !c->isfloat) - n++; + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) + n++; if(n > 1) h = (sh - bh) / (n - 1); @@ -116,8 +115,7 @@ dotile(Arg *arg) { resize(c, True, TopLeft); continue; } - if(c->ismax) - togglemax(c); + c->ismax = False; if(n == 1) { c->x = sx; c->y = sy + bh; -- 2.20.1 From bcb07de75000e75a450e4dddf851e9ce69966f59 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Mon, 25 Sep 2006 21:19:18 +0200 Subject: [PATCH 05/16] simplified mouse resizals --- event.c | 59 ++++++++++++++++----------------------------------------- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/event.c b/event.c index df0a5ef..fe25dee 100644 --- a/event.c +++ b/event.c @@ -20,23 +20,6 @@ KEYS #define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) -static void -synconfig(Client *c, int x, int y, int w, int h, unsigned int border) { - XEvent synev; - - synev.type = ConfigureNotify; - synev.xconfigure.display = dpy; - synev.xconfigure.event = c->win; - synev.xconfigure.window = c->win; - synev.xconfigure.x = x; - synev.xconfigure.y = y; - synev.xconfigure.width = w; - synev.xconfigure.height = h; - synev.xconfigure.border_width = border; - synev.xconfigure.above = None; - XSendEvent(dpy, c->win, True, NoEventMask, &synev); -} - static void movemouse(Client *c) { int x1, y1, ocx, ocy, di; @@ -52,14 +35,8 @@ movemouse(Client *c) { c->ismax = False; XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); for(;;) { - XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev); + XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch (ev.type) { - default: - break; - case ConfigureRequest: - synconfig(c, c->x, c->y, c->w, c->h, ev.xconfigure.border_width); - XSync(dpy, False); - break; case Expose: handler[Expose](&ev); break; @@ -72,11 +49,6 @@ movemouse(Client *c) { case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; - case DestroyNotify: - case UnmapNotify: - XUngrabPointer(dpy, CurrentTime); - handler[ev.type](&ev); - return; } } } @@ -96,14 +68,8 @@ resizemouse(Client *c) { c->ismax = False; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); for(;;) { - XMaskEvent(dpy, MOUSEMASK | ExposureMask | StructureNotifyMask, &ev); + XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch(ev.type) { - default: - break; - case ConfigureRequest: - synconfig(c, c->x, c->y, c->w, c->h, ev.xconfigure.border_width); - XSync(dpy, False); - break; case Expose: handler[Expose](&ev); break; @@ -124,11 +90,6 @@ resizemouse(Client *c) { case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; - case DestroyNotify: - case UnmapNotify: - XUngrabPointer(dpy, CurrentTime); - handler[ev.type](&ev); - return; } } } @@ -187,6 +148,7 @@ configurerequest(XEvent *e) { unsigned long newmask; Client *c; XConfigureRequestEvent *ev = &e->xconfigurerequest; + XEvent synev; XWindowChanges wc; if((c = getclient(ev->window))) { @@ -210,8 +172,19 @@ configurerequest(XEvent *e) { newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); if(newmask) XConfigureWindow(dpy, c->win, newmask, &wc); - else - synconfig(c, c->x, c->y, c->w, c->h, c->border); + else { + synev.type = ConfigureNotify; + synev.xconfigure.display = dpy; + synev.xconfigure.event = c->win; + synev.xconfigure.window = c->win; + synev.xconfigure.x = c->x; + synev.xconfigure.y = c->y; + synev.xconfigure.width = c->w; + synev.xconfigure.height = c->h; + synev.xconfigure.border_width = c->border; + synev.xconfigure.above = None; + XSendEvent(dpy, c->win, True, NoEventMask, &synev); + } XSync(dpy, False); if(c->isfloat) resize(c, False, TopLeft); -- 2.20.1 From 67bc08d1b938842d27d976da9bbbc210b1f860b7 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Mon, 25 Sep 2006 21:28:00 +0200 Subject: [PATCH 06/16] slight change of event handling order --- event.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/event.c b/event.c index fe25dee..cf89428 100644 --- a/event.c +++ b/event.c @@ -37,6 +37,9 @@ movemouse(Client *c) { for(;;) { XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch (ev.type) { + case ButtonRelease: + XUngrabPointer(dpy, CurrentTime); + return; case Expose: handler[Expose](&ev); break; @@ -46,9 +49,6 @@ movemouse(Client *c) { c->y = ocy + (ev.xmotion.y - y1); resize(c, False, TopLeft); break; - case ButtonRelease: - XUngrabPointer(dpy, CurrentTime); - return; } } } @@ -70,6 +70,9 @@ resizemouse(Client *c) { for(;;) { XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch(ev.type) { + case ButtonRelease: + XUngrabPointer(dpy, CurrentTime); + return; case Expose: handler[Expose](&ev); break; @@ -87,9 +90,6 @@ resizemouse(Client *c) { sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight; resize(c, True, sticky); break; - case ButtonRelease: - XUngrabPointer(dpy, CurrentTime); - return; } } } -- 2.20.1 From b4d53bf194f9f9214b6c79d397d723ba53663b4b Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 07:40:19 +0200 Subject: [PATCH 07/16] added configure(), but this doesn't really fix those frking broken SDL apps --- client.c | 18 ++++++++++++++++++ dwm.h | 1 + event.c | 21 ++++++++------------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/client.c b/client.c index d5bc30e..87c2f76 100644 --- a/client.c +++ b/client.c @@ -80,6 +80,23 @@ ban(Client *c) { XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty); } +void +configure(Client *c) { + XEvent synev; + + synev.type = ConfigureNotify; + synev.xconfigure.display = dpy; + synev.xconfigure.event = c->win; + synev.xconfigure.window = c->win; + synev.xconfigure.x = c->x; + synev.xconfigure.y = c->y; + synev.xconfigure.width = c->w; + synev.xconfigure.height = c->h; + synev.xconfigure.border_width = c->border; + synev.xconfigure.above = None; + XSendEvent(dpy, c->win, True, NoEventMask, &synev); +} + void focus(Client *c) { Client *old; @@ -299,6 +316,7 @@ resize(Client *c, Bool sizehints, Corner sticky) { else wc.border_width = 1; XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); + configure(c); XSync(dpy, False); } diff --git a/dwm.h b/dwm.h index c30f2b3..269c78e 100644 --- a/dwm.h +++ b/dwm.h @@ -109,6 +109,7 @@ extern Window root, barwin; /* client.c */ extern void ban(Client *c); /* ban c from screen */ +extern void configure(Client *c); /* send synthetic configure event */ extern void focus(Client *c); /* focus c, c may be NULL */ extern Client *getclient(Window w); /* return client of w */ extern Client *getctitle(Window w); /* return client of title window */ diff --git a/event.c b/event.c index cf89428..50c59a0 100644 --- a/event.c +++ b/event.c @@ -1,3 +1,4 @@ +#include /* * (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. @@ -38,6 +39,7 @@ movemouse(Client *c) { XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch (ev.type) { case ButtonRelease: + resize(c, True, TopLeft); XUngrabPointer(dpy, CurrentTime); return; case Expose: @@ -71,6 +73,7 @@ resizemouse(Client *c) { XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); switch(ev.type) { case ButtonRelease: + resize(c, True, TopLeft); XUngrabPointer(dpy, CurrentTime); return; case Expose: @@ -151,6 +154,7 @@ configurerequest(XEvent *e) { XEvent synev; XWindowChanges wc; + fputs("configurerequest\n", stderr); if((c = getclient(ev->window))) { c->ismax = False; gravitate(c, True); @@ -172,19 +176,8 @@ configurerequest(XEvent *e) { newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); if(newmask) XConfigureWindow(dpy, c->win, newmask, &wc); - else { - synev.type = ConfigureNotify; - synev.xconfigure.display = dpy; - synev.xconfigure.event = c->win; - synev.xconfigure.window = c->win; - synev.xconfigure.x = c->x; - synev.xconfigure.y = c->y; - synev.xconfigure.width = c->w; - synev.xconfigure.height = c->h; - synev.xconfigure.border_width = c->border; - synev.xconfigure.above = None; - XSendEvent(dpy, c->win, True, NoEventMask, &synev); - } + else + configure(c); XSync(dpy, False); if(c->isfloat) resize(c, False, TopLeft); @@ -218,6 +211,7 @@ enternotify(XEvent *e) { Client *c; XCrossingEvent *ev = &e->xcrossing; + fputs("enternotify\n", stderr); if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; @@ -305,6 +299,7 @@ propertynotify(XEvent *e) { Window trans; XPropertyEvent *ev = &e->xproperty; + fputs("propertynotify\n", stderr); if(ev->state == PropertyDelete) return; /* ignore */ -- 2.20.1 From 4d6c4d36ceaa1ca8fae6199aee6df50f6187c755 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 08:17:35 +0200 Subject: [PATCH 08/16] removed useless debug info --- event.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/event.c b/event.c index 50c59a0..afd13c8 100644 --- a/event.c +++ b/event.c @@ -1,4 +1,3 @@ -#include /* * (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. @@ -154,7 +153,6 @@ configurerequest(XEvent *e) { XEvent synev; XWindowChanges wc; - fputs("configurerequest\n", stderr); if((c = getclient(ev->window))) { c->ismax = False; gravitate(c, True); @@ -211,7 +209,6 @@ enternotify(XEvent *e) { Client *c; XCrossingEvent *ev = &e->xcrossing; - fputs("enternotify\n", stderr); if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; @@ -299,7 +296,6 @@ propertynotify(XEvent *e) { Window trans; XPropertyEvent *ev = &e->xproperty; - fputs("propertynotify\n", stderr); if(ev->state == PropertyDelete) return; /* ignore */ -- 2.20.1 From 97ced11e531f4e51d7ee248ae654a2b04daaad1c Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 13:24:14 +0200 Subject: [PATCH 09/16] changed order of colordefs in config.h's, changed config.arg.h to fit to new dmenu --- config.arg.h | 9 +++++---- config.default.h | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config.arg.h b/config.arg.h index da624a9..f91c722 100644 --- a/config.arg.h +++ b/config.arg.h @@ -11,15 +11,15 @@ const char *tags[] = { "dev", "work", "net", "fnord", NULL }; #define TILESYMBOL "[]=" #define FONT "-*-terminus-medium-*-*-*-12-*-*-*-*-*-iso10646-*" -#define SELBGCOLOR "#333366" -#define SELFGCOLOR "#eeeeee" #define NORMBGCOLOR "#333333" #define NORMFGCOLOR "#dddddd" +#define SELBGCOLOR "#333366" +#define SELFGCOLOR "#eeeeee" #define STATUSBGCOLOR "#222222" #define STATUSFGCOLOR "#9999cc" -#define MODKEY Mod1Mask #define MASTERW 60 /* percent */ +#define MODKEY Mod1Mask #define KEYS \ static Key key[] = { \ @@ -29,7 +29,8 @@ static Key key[] = { \ { MODKEY, XK_p, spawn, \ { .cmd = "exe=\"$(IFS=:; for dir in $PATH; do " \ "for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; " \ - "done | sort -u | dmenu)\" && exec $exe" } }, \ + "done | sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"'" \ + "-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \ { MODKEY, XK_Return, zoom, { 0 } }, \ diff --git a/config.default.h b/config.default.h index 9c67d98..2808ddb 100644 --- a/config.default.h +++ b/config.default.h @@ -11,15 +11,15 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL }; #define TILESYMBOL "[]=" #define FONT "fixed" -#define SELBGCOLOR "#666699" -#define SELFGCOLOR "#eeeeee" #define NORMBGCOLOR "#333366" #define NORMFGCOLOR "#cccccc" +#define SELBGCOLOR "#666699" +#define SELFGCOLOR "#eeeeee" #define STATUSBGCOLOR "#dddddd" #define STATUSFGCOLOR "#222222" -#define MODKEY Mod1Mask #define MASTERW 60 /* percent */ +#define MODKEY Mod1Mask #define KEYS \ static Key key[] = { \ -- 2.20.1 From f315832f75ce9f419a2942bc29fcaa737e8b2883 Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 13:30:30 +0200 Subject: [PATCH 10/16] small fix --- config.arg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.arg.h b/config.arg.h index f91c722..50a9fb3 100644 --- a/config.arg.h +++ b/config.arg.h @@ -29,7 +29,7 @@ static Key key[] = { \ { MODKEY, XK_p, spawn, \ { .cmd = "exe=\"$(IFS=:; for dir in $PATH; do " \ "for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; " \ - "done | sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"'" \ + "done | sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \ "-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \ -- 2.20.1 From e81eb46a78c45b41ce7126f980b6d6d8a8ff25da Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 13:49:16 +0200 Subject: [PATCH 11/16] added slight error check to getcolor --- draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draw.c b/draw.c index 3fbac5b..362d025 100644 --- a/draw.c +++ b/draw.c @@ -149,7 +149,8 @@ getcolor(const char *colstr) { Colormap cmap = DefaultColormap(dpy, screen); XColor color; - XAllocNamedColor(dpy, cmap, colstr, &color, &color); + if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color)) + eprint("error, cannot allocate color '%s'\n", colstr); return color.pixel; } -- 2.20.1 From 4ee05b3294a863408d8410e46daef0712e1f1ffb Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 14:08:42 +0200 Subject: [PATCH 12/16] small change --- config.arg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.arg.h b/config.arg.h index 50a9fb3..21c95e5 100644 --- a/config.arg.h +++ b/config.arg.h @@ -28,8 +28,8 @@ static Key key[] = { \ { .cmd = "exec uxterm -bg '#111111' -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \ { MODKEY, XK_p, spawn, \ { .cmd = "exe=\"$(IFS=:; for dir in $PATH; do " \ - "for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; " \ - "done | sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \ + "for file in \"$dir\"/*; do [ -x \"$file\" ] && echo \"${file##*/}\"; done; done " \ + "| sort -u | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \ "-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \ -- 2.20.1 From e87bed6df228844f130eff6f1ab63b386b88a34b Mon Sep 17 00:00:00 2001 From: "arg@mmvi" Date: Tue, 26 Sep 2006 14:32:02 +0200 Subject: [PATCH 13/16] updated README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 4860bbe..7da2cb7 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ dwm - dynamic window manager ----------------------------- +============================ dwm is an extremely fast, small, and dynamic window manager for X. -- 2.20.1 From b39d0c521ae07117dfb1f2602ece053d25a1ea55 Mon Sep 17 00:00:00 2001 From: "arg@zarathustra" Date: Tue, 26 Sep 2006 17:39:30 +0200 Subject: [PATCH 14/16] Added tag 1.7 for changeset 4dbdb61c8b8ce21dee5c7050a6b103855964ed20 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index e9c9eea..0c738c0 100644 --- a/.hgtags +++ b/.hgtags @@ -14,3 +14,4 @@ f5f5cbf016a94b48a8fe9c47f0736e96d166d5d4 1.3 3cff9403766bf83a9fc2a0aef230115d68de2a8e 1.4 728c9089b079721b43c3347124639a29baa22a97 1.5 ad3fa2d185426c51fd5deceae809770363f8d33c 1.6 +4dbdb61c8b8ce21dee5c7050a6b103855964ed20 1.7 -- 2.20.1 From c9cc2b385aade3ce7db1404f4b5f8cd6e41e6bae Mon Sep 17 00:00:00 2001 From: "arg@zarathustra" Date: Tue, 26 Sep 2006 17:42:14 +0200 Subject: [PATCH 15/16] removed an unused var --- event.c | 1 - 1 file changed, 1 deletion(-) diff --git a/event.c b/event.c index afd13c8..76f3602 100644 --- a/event.c +++ b/event.c @@ -150,7 +150,6 @@ configurerequest(XEvent *e) { unsigned long newmask; Client *c; XConfigureRequestEvent *ev = &e->xconfigurerequest; - XEvent synev; XWindowChanges wc; if((c = getclient(ev->window))) { -- 2.20.1 From 6092aa977e9cc87bcf72713af8e7c698ddea4b56 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 27 Sep 2006 17:18:46 +0200 Subject: [PATCH 16/16] fixing the settags issue, preparing 1.7.1 --- client.c | 30 +++++++++++++++--------------- config.mk | 2 +- dwm.h | 1 + event.c | 1 + 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/client.c b/client.c index 87c2f76..6b0322e 100644 --- a/client.c +++ b/client.c @@ -54,19 +54,6 @@ grabbuttons(Client *c, Bool focused) { GrabModeAsync, GrabModeSync, None, None); } -static void -resizetitle(Client *c) { - c->tw = textw(c->name); - if(c->tw > c->w) - c->tw = c->w + 2; - c->tx = c->x + c->w - c->tw + 2; - c->ty = c->y; - if(isvisible(c)) - XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); - else - XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); -} - static int xerrordummy(Display *dsply, XErrorEvent *ee) { return 0; @@ -250,11 +237,13 @@ manage(Window w, XWindowAttributes *wa) { CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); grabbuttons(c, False); + updatetitle(c); settags(c, getclient(trans)); if(!c->isfloat) c->isfloat = trans || (c->maxw && c->minw && c->maxw == c->minw && c->maxh == c->minh); + resizetitle(c); if(clients) clients->prev = c; @@ -262,7 +251,6 @@ manage(Window w, XWindowAttributes *wa) { c->snext = stack; stack = clients = c; - updatetitle(c); ban(c); XMapWindow(dpy, c->win); XMapWindow(dpy, c->twin); @@ -320,6 +308,19 @@ resize(Client *c, Bool sizehints, Corner sticky) { XSync(dpy, False); } +void +resizetitle(Client *c) { + c->tw = textw(c->name); + if(c->tw > c->w) + c->tw = c->w + 2; + c->tx = c->x + c->w - c->tw + 2; + c->ty = c->y; + if(isvisible(c)) + XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); + else + XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); +} + void updatesize(Client *c) { long msize; @@ -382,7 +383,6 @@ updatetitle(Client *c) { } } XFree(name.value); - resizetitle(c); } void diff --git a/config.mk b/config.mk index 8282cb4..3872652 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 1.7 +VERSION = 1.7.1 # Customize below to fit your system diff --git a/dwm.h b/dwm.h index 269c78e..85c85a3 100644 --- a/dwm.h +++ b/dwm.h @@ -117,6 +117,7 @@ extern void gravitate(Client *c, Bool invert); /* gravitate c */ extern void killclient(Arg *arg); /* kill c nicely */ extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/ +extern void resizetitle(Client *c); /* resizes c->twin correctly */ extern void updatesize(Client *c); /* update the size structs of c */ extern void updatetitle(Client *c); /* update the name of c */ extern void unmanage(Client *c); /* destroy c */ diff --git a/event.c b/event.c index 76f3602..2df3821 100644 --- a/event.c +++ b/event.c @@ -316,6 +316,7 @@ propertynotify(XEvent *e) { } if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { updatetitle(c); + resizetitle(c); drawtitle(c); } } -- 2.20.1