resize handles offscreen issues e0f03978
Anselm R Garbe · 2008-02-20 08:13 1 file(s) · +11 −13
dwm.c +11 −13
1263 1263
1264 1264
void
1265 1265
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
1266 +
	Monitor *m;
1266 1267
	XWindowChanges wc;
1267 -
	//Monitor scr = monitors[monitorat()];
1268 -
//	c->monitor = monitorat();
1268 +
1269 +
	m = &monitors[c->monitor];
1269 1270
1270 1271
	if(sizehints) {
1271 1272
		/* set minimum possible */
1307 1308
	}
1308 1309
	if(w <= 0 || h <= 0)
1309 1310
		return;
1310 -
	/* TODO: offscreen appearance fixes */
1311 -
	/*
1312 -
	if(x > scr.sw)
1313 -
		x = scr.sw - w - 2 * c->border;
1314 -
	if(y > scr.sh)
1315 -
		y = scr.sh - h - 2 * c->border;
1316 -
	if(x + w + 2 * c->border < scr.sx)
1317 -
		x = scr.sx;
1318 -
	if(y + h + 2 * c->border < scr.sy)
1319 -
		y = scr.sy;
1320 -
	*/
1311 +
	if(x > m->sw)
1312 +
		x = m->sw - w - 2 * c->border;
1313 +
	if(y > m->sh)
1314 +
		y = m->sh - h - 2 * c->border;
1315 +
	if(x + w + 2 * c->border < m->sx)
1316 +
		x = m->sx;
1317 +
	if(y + h + 2 * c->border < m->sy)
1318 +
		y = m->sy;
1321 1319
	if(c->x != x || c->y != y || c->w != w || c->h != h) {
1322 1320
		c->x = wc.x = x;
1323 1321
		c->y = wc.y = y;