diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2010-09-25 13:39:08 +0000 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2010-09-25 13:39:08 +0000 |
| commit | c1f8688bfa56e388dac0e0a9abc90fdb0324b6db (patch) | |
| tree | 30899e710f20a76d895e69529300c027021da84d /dwm.c | |
| parent | does this make a difference? (diff) | |
| download | dwm-c1f8688bfa56e388dac0e0a9abc90fdb0324b6db.tar.gz dwm-c1f8688bfa56e388dac0e0a9abc90fdb0324b6db.zip | |
applied Hiltjo's tiny cleanup patch, thanks!
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 20 |
1 files changed, 8 insertions, 12 deletions
| @@ -372,10 +372,8 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact) { | |||
| 372 | if(c->inch) | 372 | if(c->inch) |
| 373 | *h -= *h % c->inch; | 373 | *h -= *h % c->inch; |
| 374 | /* restore base dimensions */ | 374 | /* restore base dimensions */ |
| 375 | *w += c->basew; | 375 | *w = MAX(*w + c->basew, c->minw); |
| 376 | *h += c->baseh; | 376 | *h = MAX(*h + c->baseh, c->minh); |
| 377 | *w = MAX(*w, c->minw); | ||
| 378 | *h = MAX(*h, c->minh); | ||
| 379 | if(c->maxw) | 377 | if(c->maxw) |
| 380 | *w = MIN(*w, c->maxw); | 378 | *w = MIN(*w, c->maxw); |
| 381 | if(c->maxh) | 379 | if(c->maxh) |
| @@ -845,7 +843,7 @@ focusin(XEvent *e) { /* there are some broken focus acquiring clients */ | |||
| 845 | 843 | ||
| 846 | void | 844 | void |
| 847 | focusmon(const Arg *arg) { | 845 | focusmon(const Arg *arg) { |
| 848 | Monitor *m = NULL; | 846 | Monitor *m; |
| 849 | 847 | ||
| 850 | if(!mons->next) | 848 | if(!mons->next) |
| 851 | return; | 849 | return; |
| @@ -1100,9 +1098,7 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1100 | *c = cz; | 1098 | *c = cz; |
| 1101 | c->win = w; | 1099 | c->win = w; |
| 1102 | updatetitle(c); | 1100 | updatetitle(c); |
| 1103 | if(XGetTransientForHint(dpy, w, &trans)) | 1101 | if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { |
| 1104 | t = wintoclient(trans); | ||
| 1105 | if(t) { | ||
| 1106 | c->mon = t->mon; | 1102 | c->mon = t->mon; |
| 1107 | c->tags = t->tags; | 1103 | c->tags = t->tags; |
| 1108 | } | 1104 | } |
| @@ -1117,7 +1113,7 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1117 | c->h = c->oldh = wa->height; | 1113 | c->h = c->oldh = wa->height; |
| 1118 | c->oldbw = wa->border_width; | 1114 | c->oldbw = wa->border_width; |
| 1119 | if(c->w == c->mon->mw && c->h == c->mon->mh) { | 1115 | if(c->w == c->mon->mw && c->h == c->mon->mh) { |
| 1120 | c->isfloating = 1; | 1116 | c->isfloating = True; |
| 1121 | c->x = c->mon->mx; | 1117 | c->x = c->mon->mx; |
| 1122 | c->y = c->mon->my; | 1118 | c->y = c->mon->my; |
| 1123 | c->bw = 0; | 1119 | c->bw = 0; |
| @@ -1273,8 +1269,8 @@ propertynotify(XEvent *e) { | |||
| 1273 | switch (ev->atom) { | 1269 | switch (ev->atom) { |
| 1274 | default: break; | 1270 | default: break; |
| 1275 | case XA_WM_TRANSIENT_FOR: | 1271 | case XA_WM_TRANSIENT_FOR: |
| 1276 | XGetTransientForHint(dpy, c->win, &trans); | 1272 | if(!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && |
| 1277 | if(!c->isfloating && (c->isfloating = (wintoclient(trans) != NULL))) | 1273 | (c->isfloating = (wintoclient(trans)))) |
| 1278 | arrange(c->mon); | 1274 | arrange(c->mon); |
| 1279 | break; | 1275 | break; |
| 1280 | case XA_WM_NORMAL_HINTS: | 1276 | case XA_WM_NORMAL_HINTS: |
| @@ -1307,7 +1303,7 @@ clientmessage(XEvent *e) { | |||
| 1307 | c->oldstate = c->isfloating; | 1303 | c->oldstate = c->isfloating; |
| 1308 | c->oldbw = c->bw; | 1304 | c->oldbw = c->bw; |
| 1309 | c->bw = 0; | 1305 | c->bw = 0; |
| 1310 | c->isfloating = 1; | 1306 | c->isfloating = True; |
| 1311 | resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); | 1307 | resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); |
| 1312 | XRaiseWindow(dpy, c->win); | 1308 | XRaiseWindow(dpy, c->win); |
| 1313 | } | 1309 | } |
