summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-06-01 10:54:02 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-06-01 10:54:02 +0100
commitc2784e4a38f2305a444abaaf77f39219bd9f56e5 (patch)
tree80e711de542cbb383564b0d2d08831fad53e8daa
parentfix (diff)
downloaddwm-c2784e4a38f2305a444abaaf77f39219bd9f56e5.tar.gz
dwm-c2784e4a38f2305a444abaaf77f39219bd9f56e5.zip
applied noviewprev.diff, fix.diff and unusedflags.diff
-rw-r--r--config.def.h2
-rw-r--r--dwm.c39
2 files changed, 17 insertions, 24 deletions
diff --git a/config.def.h b/config.def.h
index 5154405..b18af75 100644
--- a/config.def.h
+++ b/config.def.h
@@ -51,7 +51,7 @@ Key keys[] = {
51 { MODKEY, XK_l, setmfact, (double[]){+0.05} }, 51 { MODKEY, XK_l, setmfact, (double[]){+0.05} },
52 { MODKEY, XK_m, togglemax, NULL }, 52 { MODKEY, XK_m, togglemax, NULL },
53 { MODKEY, XK_Return, zoom, NULL }, 53 { MODKEY, XK_Return, zoom, NULL },
54 { MODKEY, XK_Tab, viewprevtag, NULL }, 54 { MODKEY, XK_Tab, view, NULL },
55 { MODKEY|ShiftMask, XK_c, killclient, NULL }, 55 { MODKEY|ShiftMask, XK_c, killclient, NULL },
56 { MODKEY, XK_space, togglelayout, NULL }, 56 { MODKEY, XK_space, togglelayout, NULL },
57 { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, 57 { MODKEY|ShiftMask, XK_space, togglefloating, NULL },
diff --git a/dwm.c b/dwm.c
index 3cff294..4d4c769 100644
--- a/dwm.c
+++ b/dwm.c
@@ -69,7 +69,6 @@ struct Client {
69 int x, y, w, h; 69 int x, y, w, h;
70 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 70 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
71 int minax, maxax, minay, maxay; 71 int minax, maxax, minay, maxay;
72 long flags;
73 int bw, oldbw; 72 int bw, oldbw;
74 Bool isbanned, isfixed, isfloating, ismoved, isurgent; 73 Bool isbanned, isfixed, isfloating, ismoved, isurgent;
75 uint tags; 74 uint tags;
@@ -183,7 +182,6 @@ void updatesizehints(Client *c);
183void updatetitle(Client *c); 182void updatetitle(Client *c);
184void updatewmhints(Client *c); 183void updatewmhints(Client *c);
185void view(const void *arg); 184void view(const void *arg);
186void viewprevtag(const void *arg);
187int xerror(Display *dpy, XErrorEvent *ee); 185int xerror(Display *dpy, XErrorEvent *ee);
188int xerrordummy(Display *dpy, XErrorEvent *ee); 186int xerrordummy(Display *dpy, XErrorEvent *ee);
189int xerrorstart(Display *dpy, XErrorEvent *ee); 187int xerrorstart(Display *dpy, XErrorEvent *ee);
@@ -419,7 +417,9 @@ configurerequest(XEvent *e) {
419 if((c = getclient(ev->window))) { 417 if((c = getclient(ev->window))) {
420 if(ev->value_mask & CWBorderWidth) 418 if(ev->value_mask & CWBorderWidth)
421 c->bw = ev->border_width; 419 c->bw = ev->border_width;
422 if(c->isfixed || c->isfloating || !lt->arrange) { 420 if(ismax && !c->isbanned && !c->isfixed)
421 XMoveResizeWindow(dpy, c->win, wx, wy, ww - 2 * c->bw, wh + 2 * c->bw);
422 else if(c->isfloating || !lt->arrange) {
423 if(ev->value_mask & CWX) 423 if(ev->value_mask & CWX)
424 c->x = sx + ev->x; 424 c->x = sx + ev->x;
425 if(ev->value_mask & CWY) 425 if(ev->value_mask & CWY)
@@ -946,6 +946,8 @@ manage(Window w, XWindowAttributes *wa) {
946 applyrules(c); 946 applyrules(c);
947 if(!c->isfloating) 947 if(!c->isfloating)
948 c->isfloating = (rettrans == Success) || c->isfixed; 948 c->isfloating = (rettrans == Success) || c->isfixed;
949 if(c->isfloating)
950 XRaiseWindow(dpy, c->win);
949 attach(c); 951 attach(c);
950 attachstack(c); 952 attachstack(c);
951 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ 953 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
@@ -1124,7 +1126,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1124 if(w < bh) 1126 if(w < bh)
1125 w = bh; 1127 w = bh;
1126 if(c->x != x || c->y != y || c->w != w || c->h != h || c->ismoved) { 1128 if(c->x != x || c->y != y || c->w != w || c->h != h || c->ismoved) {
1127 c->isbanned = c->ismoved = False; 1129 c->ismoved = False;
1128 c->x = wc.x = x; 1130 c->x = wc.x = x;
1129 c->y = wc.y = y; 1131 c->y = wc.y = y;
1130 c->w = wc.width = w; 1132 c->w = wc.width = w;
@@ -1601,42 +1603,40 @@ updatesizehints(Client *c) {
1601 long msize; 1603 long msize;
1602 XSizeHints size; 1604 XSizeHints size;
1603 1605
1604 if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) 1606 XGetWMNormalHints(dpy, c->win, &size, &msize);
1605 size.flags = PSize; 1607 if(size.flags & PBaseSize) {
1606 c->flags = size.flags;
1607 if(c->flags & PBaseSize) {
1608 c->basew = size.base_width; 1608 c->basew = size.base_width;
1609 c->baseh = size.base_height; 1609 c->baseh = size.base_height;
1610 } 1610 }
1611 else if(c->flags & PMinSize) { 1611 else if(size.flags & PMinSize) {
1612 c->basew = size.min_width; 1612 c->basew = size.min_width;
1613 c->baseh = size.min_height; 1613 c->baseh = size.min_height;
1614 } 1614 }
1615 else 1615 else
1616 c->basew = c->baseh = 0; 1616 c->basew = c->baseh = 0;
1617 if(c->flags & PResizeInc) { 1617 if(size.flags & PResizeInc) {
1618 c->incw = size.width_inc; 1618 c->incw = size.width_inc;
1619 c->inch = size.height_inc; 1619 c->inch = size.height_inc;
1620 } 1620 }
1621 else 1621 else
1622 c->incw = c->inch = 0; 1622 c->incw = c->inch = 0;
1623 if(c->flags & PMaxSize) { 1623 if(size.flags & PMaxSize) {
1624 c->maxw = size.max_width; 1624 c->maxw = size.max_width;
1625 c->maxh = size.max_height; 1625 c->maxh = size.max_height;
1626 } 1626 }
1627 else 1627 else
1628 c->maxw = c->maxh = 0; 1628 c->maxw = c->maxh = 0;
1629 if(c->flags & PMinSize) { 1629 if(size.flags & PMinSize) {
1630 c->minw = size.min_width; 1630 c->minw = size.min_width;
1631 c->minh = size.min_height; 1631 c->minh = size.min_height;
1632 } 1632 }
1633 else if(c->flags & PBaseSize) { 1633 else if(size.flags & PBaseSize) {
1634 c->minw = size.base_width; 1634 c->minw = size.base_width;
1635 c->minh = size.base_height; 1635 c->minh = size.base_height;
1636 } 1636 }
1637 else 1637 else
1638 c->minw = c->minh = 0; 1638 c->minw = c->minh = 0;
1639 if(c->flags & PAspect) { 1639 if(size.flags & PAspect) {
1640 c->minax = size.min_aspect.x; 1640 c->minax = size.min_aspect.x;
1641 c->maxax = size.max_aspect.x; 1641 c->maxax = size.max_aspect.x;
1642 c->minay = size.min_aspect.y; 1642 c->minay = size.min_aspect.y;
@@ -1669,16 +1669,9 @@ updatewmhints(Client *c) {
1669 1669
1670void 1670void
1671view(const void *arg) { 1671view(const void *arg) {
1672 if(*(int *)arg & TAGMASK) {
1673 seltags ^= 1; /* toggle sel tagset */
1674 tagset[seltags] = *(int *)arg & TAGMASK;
1675 arrange();
1676 }
1677}
1678
1679void
1680viewprevtag(const void *arg) {
1681 seltags ^= 1; /* toggle sel tagset */ 1672 seltags ^= 1; /* toggle sel tagset */
1673 if(arg && (*(int *)arg & TAGMASK))
1674 tagset[seltags] = *(int *)arg & TAGMASK;
1682 arrange(); 1675 arrange();
1683} 1676}
1684 1677