diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2009-06-30 19:56:19 +0100 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2009-06-30 19:56:19 +0100 |
| commit | 183dc670a3917663a4fe7e7cd1f0ddba1d9fda64 (patch) | |
| tree | 8bb6c41c217fdfe0f3c9a7101b15da8157a9b93d | |
| parent | hotfix (diff) | |
| download | dwm-183dc670a3917663a4fe7e7cd1f0ddba1d9fda64.tar.gz dwm-183dc670a3917663a4fe7e7cd1f0ddba1d9fda64.zip | |
fixed order of transient monitor applicaion and rule application
| -rw-r--r-- | dwm.c | 40 |
1 files changed, 22 insertions, 18 deletions
| @@ -1046,28 +1046,38 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1046 | die("fatal: could not malloc() %u bytes\n", sizeof(Client)); | 1046 | die("fatal: could not malloc() %u bytes\n", sizeof(Client)); |
| 1047 | *c = cz; | 1047 | *c = cz; |
| 1048 | c->win = w; | 1048 | c->win = w; |
| 1049 | c->mon = selmon; | 1049 | |
| 1050 | if(XGetTransientForHint(dpy, w, &trans)) | ||
| 1051 | t = wintoclient(trans); | ||
| 1052 | if(t) { | ||
| 1053 | c->mon = t->mon; | ||
| 1054 | c->tags = t->tags; | ||
| 1055 | } | ||
| 1056 | else { | ||
| 1057 | c->mon = selmon; | ||
| 1058 | applyrules(c); | ||
| 1059 | } | ||
| 1050 | 1060 | ||
| 1051 | /* geometry */ | 1061 | /* geometry */ |
| 1052 | c->x = wa->x + selmon->wx; | 1062 | c->x = wa->x + c->mon->wx; |
| 1053 | c->y = wa->y + selmon->wy; | 1063 | c->y = wa->y + c->mon->wy; |
| 1054 | c->w = wa->width; | 1064 | c->w = wa->width; |
| 1055 | c->h = wa->height; | 1065 | c->h = wa->height; |
| 1056 | c->oldbw = wa->border_width; | 1066 | c->oldbw = wa->border_width; |
| 1057 | if(c->w == selmon->mw && c->h == selmon->mh) { | 1067 | if(c->w == c->mon->mw && c->h == c->mon->mh) { |
| 1058 | c->x = selmon->mx; | 1068 | c->x = c->mon->mx; |
| 1059 | c->y = selmon->my; | 1069 | c->y = c->mon->my; |
| 1060 | c->bw = 0; | 1070 | c->bw = 0; |
| 1061 | } | 1071 | } |
| 1062 | else { | 1072 | else { |
| 1063 | if(c->x + WIDTH(c) > selmon->mx + selmon->mw) | 1073 | if(c->x + WIDTH(c) > c->mon->mx + c->mon->mw) |
| 1064 | c->x = selmon->mx + selmon->mw - WIDTH(c); | 1074 | c->x = c->mon->mx + c->mon->mw - WIDTH(c); |
| 1065 | if(c->y + HEIGHT(c) > selmon->my + selmon->mh) | 1075 | if(c->y + HEIGHT(c) > c->mon->my + c->mon->mh) |
| 1066 | c->y = selmon->my + selmon->mh - HEIGHT(c); | 1076 | c->y = c->mon->my + c->mon->mh - HEIGHT(c); |
| 1067 | c->x = MAX(c->x, selmon->mx); | 1077 | c->x = MAX(c->x, c->mon->mx); |
| 1068 | /* only fix client y-offset, if the client center might cover the bar */ | 1078 | /* only fix client y-offset, if the client center might cover the bar */ |
| 1069 | c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx) | 1079 | c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx) |
| 1070 | && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : selmon->my); | 1080 | && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); |
| 1071 | c->bw = borderpx; | 1081 | c->bw = borderpx; |
| 1072 | } | 1082 | } |
| 1073 | 1083 | ||
| @@ -1079,12 +1089,6 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1079 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); | 1089 | XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); |
| 1080 | grabbuttons(c, False); | 1090 | grabbuttons(c, False); |
| 1081 | updatetitle(c); | 1091 | updatetitle(c); |
| 1082 | if(XGetTransientForHint(dpy, w, &trans)) | ||
| 1083 | t = wintoclient(trans); | ||
| 1084 | if(t) | ||
| 1085 | c->tags = t->tags; | ||
| 1086 | else | ||
| 1087 | applyrules(c); | ||
| 1088 | if(!c->isfloating) | 1092 | if(!c->isfloating) |
| 1089 | c->isfloating = trans != None || c->isfixed; | 1093 | c->isfloating = trans != None || c->isfixed; |
| 1090 | if(c->isfloating) | 1094 | if(c->isfloating) |
