applied Maarten Maathuis recenter-patch for floating clients only requesting new width and height exceeding the screen space
b6b2f584
1 file(s) · +4 −0
| 185 | 185 | c->w = ev->width; |
|
| 186 | 186 | if(ev->value_mask & CWHeight) |
|
| 187 | 187 | c->h = ev->height; |
|
| 188 | + | if((c->x + c->w) > sw && c->isfloating) |
|
| 189 | + | c->x = sw / 2 - c->w / 2; /* center in x direction */ |
|
| 190 | + | if((c->y + c->h) > sh && c->isfloating) |
|
| 191 | + | c->y = sh / 2 - c->h / 2; /* center in y direction */ |
|
| 188 | 192 | if((ev->value_mask & (CWX | CWY)) |
|
| 189 | 193 | && !(ev->value_mask & (CWWidth | CWHeight))) |
|
| 190 | 194 | configure(c); |