applied offscreen appearance hotfix
1f184664
1 file(s) · +8 −8
| 142 | 142 | } |
|
| 143 | 143 | else { |
|
| 144 | 144 | c->border = BORDERPX; |
|
| 145 | + | if(c->x + c->w + 2 * c->border > wax + waw) |
|
| 146 | + | c->x = wax + waw - c->w - 2 * c->border; |
|
| 147 | + | if(c->y + c->h + 2 * c->border > way + wah) |
|
| 148 | + | c->y = way + wah - c->h - 2 * c->border; |
|
| 145 | 149 | if(c->x < wax) |
|
| 146 | 150 | c->x = wax; |
|
| 147 | 151 | if(c->y < way) |
|
| 148 | 152 | c->y = way; |
|
| 149 | - | if(c->x + c->w + 2 * c->border > wax + waw) |
|
| 150 | - | c->x = wax + waw - c->w - 2 * c->border; |
|
| 151 | - | if(c->y + c->h + 2 * c->border > way + wah) |
|
| 152 | - | c->y = way + wah - c->h - 2 * c->border; |
|
| 153 | 153 | } |
|
| 154 | 154 | updatesizehints(c); |
|
| 155 | 155 | c->proto = getproto(c->win); |
|
| 197 | 197 | else |
|
| 198 | 198 | c->border = BORDERPX; |
|
| 199 | 199 | /* offscreen appearance fixes */ |
|
| 200 | + | if(c->x > sw) |
|
| 201 | + | c->x = sw - c->w - 2 * c->border; |
|
| 202 | + | if(c->y > sh) |
|
| 203 | + | c->y = sh - c->h - 2 * c->border; |
|
| 200 | 204 | if(c->x + c->w + 2 * c->border < sx) |
|
| 201 | 205 | c->x = sx; |
|
| 202 | 206 | if(c->y + c->h + 2 * c->border < sy) |
|
| 203 | 207 | c->y = sy; |
|
| 204 | - | if(c->x > sw) |
|
| 205 | - | c->x = sw - c->w - 2 * c->border; |
|
| 206 | - | if(c->y > sh) |
|
| 207 | - | c->y = sh - c->h - 2 * c->border; |
|
| 208 | 208 | wc.x = c->x; |
|
| 209 | 209 | wc.y = c->y; |
|
| 210 | 210 | wc.width = c->w; |
|