diff options
| -rw-r--r-- | dwm.c | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -1968,32 +1968,32 @@ updatesizehints(Client *c) | |||
| 1968 | /* size is uninitialized, ensure that size.flags aren't used */ | 1968 | /* size is uninitialized, ensure that size.flags aren't used */ |
| 1969 | size.flags = PSize; | 1969 | size.flags = PSize; |
| 1970 | if (size.flags & PBaseSize) { | 1970 | if (size.flags & PBaseSize) { |
| 1971 | c->basew = size.base_width; | 1971 | c->basew = MAX(0, size.base_width); |
| 1972 | c->baseh = size.base_height; | 1972 | c->baseh = MAX(0, size.base_height); |
| 1973 | } else if (size.flags & PMinSize) { | 1973 | } else if (size.flags & PMinSize) { |
| 1974 | c->basew = size.min_width; | 1974 | c->basew = MAX(0, size.min_width); |
| 1975 | c->baseh = size.min_height; | 1975 | c->baseh = MAX(0, size.min_height); |
| 1976 | } else | 1976 | } else |
| 1977 | c->basew = c->baseh = 0; | 1977 | c->basew = c->baseh = 0; |
| 1978 | if (size.flags & PResizeInc) { | 1978 | if (size.flags & PResizeInc) { |
| 1979 | c->incw = size.width_inc; | 1979 | c->incw = MAX(0, size.width_inc); |
| 1980 | c->inch = size.height_inc; | 1980 | c->inch = MAX(0, size.height_inc); |
| 1981 | } else | 1981 | } else |
| 1982 | c->incw = c->inch = 0; | 1982 | c->incw = c->inch = 0; |
| 1983 | if (size.flags & PMaxSize) { | 1983 | if (size.flags & PMaxSize) { |
| 1984 | c->maxw = size.max_width; | 1984 | c->maxw = MAX(0, size.max_width); |
| 1985 | c->maxh = size.max_height; | 1985 | c->maxh = MAX(0, size.max_height); |
| 1986 | } else | 1986 | } else |
| 1987 | c->maxw = c->maxh = 0; | 1987 | c->maxw = c->maxh = 0; |
| 1988 | if (size.flags & PMinSize) { | 1988 | if (size.flags & PMinSize) { |
| 1989 | c->minw = size.min_width; | 1989 | c->minw = MAX(0, size.min_width); |
| 1990 | c->minh = size.min_height; | 1990 | c->minh = MAX(0, size.min_height); |
| 1991 | } else if (size.flags & PBaseSize) { | 1991 | } else if (size.flags & PBaseSize) { |
| 1992 | c->minw = size.base_width; | 1992 | c->minw = MAX(0, size.base_width); |
| 1993 | c->minh = size.base_height; | 1993 | c->minh = MAX(0, size.base_height); |
| 1994 | } else | 1994 | } else |
| 1995 | c->minw = c->minh = 0; | 1995 | c->minw = c->minh = 0; |
| 1996 | if (size.flags & PAspect) { | 1996 | if ((size.flags & PAspect) && size.min_aspect.x > 0 && size.max_aspect.y > 0) { |
| 1997 | c->mina = (float)size.min_aspect.y / size.min_aspect.x; | 1997 | c->mina = (float)size.min_aspect.y / size.min_aspect.x; |
| 1998 | c->maxa = (float)size.max_aspect.x / size.max_aspect.y; | 1998 | c->maxa = (float)size.max_aspect.x / size.max_aspect.y; |
| 1999 | } else | 1999 | } else |
