- /* try min max */
- if (win->sh.flags & PMinSize) {
- /* some hints are retarded */
- if (win->sh.min_width < WIDTH / 10)
- win->sh.min_width = WIDTH / 3;
- if (win->sh.min_height < HEIGHT / 10)
- win->sh.height = HEIGHT / 3;
-
- win->g.w = wc.width = win->sh.min_width * 2;
- win->g.h = wc.height = win->sh.min_height * 2;
- mask |= CWWidth | CWHeight;
- }
- if (win->sh.flags & PMaxSize) {
- /* potentially override min values */
- if (win->sh.max_width < WIDTH) {
- win->g.w = wc.width = win->sh.max_width;
- mask |= CWWidth;
- }
- if (win->sh.max_height < HEIGHT) {
- win->g.h = wc.height = win->sh.max_height;
- mask |= CWHeight;
- }
- }
-
- /* make sure we don't clobber the screen */
- if ((mask & CWWidth) && win->wa.width > WIDTH)
- win->wa.width = WIDTH - 4;
- if ((mask & CWHeight) && win->wa.height > HEIGHT)
- win->wa.height = HEIGHT - 4;
-
- /* supposed to be obsolete */
- if (win->sh.flags & USPosition) {
- win->g.x = wc.x = win->sh.x;
- win->g.y = wc.y = win->sh.y;
- } else {
- win->g.x = wc.x = (WIDTH - win->wa.width) / 2;
- win->g.y = wc.y = (HEIGHT - win->wa.height) / 2;
- }