summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index 85762e2..cbe2752 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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
846void 844void
847focusmon(const Arg *arg) { 845focusmon(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 }