resize handles offscreen issues
This commit is contained in:
parent
ca3e847e45
commit
e0f0397896
24
dwm.c
24
dwm.c
|
@ -1263,9 +1263,10 @@ reapply(const char *arg) {
|
||||||
|
|
||||||
void
|
void
|
||||||
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
||||||
|
Monitor *m;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
//Monitor scr = monitors[monitorat()];
|
|
||||||
// c->monitor = monitorat();
|
m = &monitors[c->monitor];
|
||||||
|
|
||||||
if(sizehints) {
|
if(sizehints) {
|
||||||
/* set minimum possible */
|
/* set minimum possible */
|
||||||
|
@ -1307,17 +1308,14 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
||||||
}
|
}
|
||||||
if(w <= 0 || h <= 0)
|
if(w <= 0 || h <= 0)
|
||||||
return;
|
return;
|
||||||
/* TODO: offscreen appearance fixes */
|
if(x > m->sw)
|
||||||
/*
|
x = m->sw - w - 2 * c->border;
|
||||||
if(x > scr.sw)
|
if(y > m->sh)
|
||||||
x = scr.sw - w - 2 * c->border;
|
y = m->sh - h - 2 * c->border;
|
||||||
if(y > scr.sh)
|
if(x + w + 2 * c->border < m->sx)
|
||||||
y = scr.sh - h - 2 * c->border;
|
x = m->sx;
|
||||||
if(x + w + 2 * c->border < scr.sx)
|
if(y + h + 2 * c->border < m->sy)
|
||||||
x = scr.sx;
|
y = m->sy;
|
||||||
if(y + h + 2 * c->border < scr.sy)
|
|
||||||
y = scr.sy;
|
|
||||||
*/
|
|
||||||
if(c->x != x || c->y != y || c->w != w || c->h != h) {
|
if(c->x != x || c->y != y || c->w != w || c->h != h) {
|
||||||
c->x = wc.x = x;
|
c->x = wc.x = x;
|
||||||
c->y = wc.y = y;
|
c->y = wc.y = y;
|
||||||
|
|
Loading…
Reference in New Issue