new stuff a55f0e12
arg@10ksloc.org · 2006-08-02 13:05 2 file(s) · +23 −20
client.c +21 −15
219 219
	c->h = wa->height;
220 220
	c->th = bh;
221 221
222 -
	if(c->y < bh)
222 +
	c->border = 1;
223 +
	setsize(c);
224 +
225 +
	if(c->h != sh && c->y < bh)
223 226
		c->y = c->ty = bh;
224 227
225 -
	c->border = 1;
226 228
	c->proto = getproto(c->win);
227 -
	setsize(c);
228 229
	XSelectInput(dpy, c->win,
229 230
		StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
230 231
	XGetTransientForHint(dpy, c->win, &trans);
236 237
			0, DefaultDepth(dpy, screen), CopyFromParent,
237 238
			DefaultVisual(dpy, screen),
238 239
			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
239 -
240 -
	settags(c);
241 240
242 241
	if(clients)
243 242
		clients->prev = c;
251 250
	XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK,
252 251
			GrabModeAsync, GrabModeSync, None, None);
253 252
253 +
	settags(c);
254 254
	if(!c->isfloat)
255 -
		c->isfloat = trans || (c->maxw && c->minw &&
256 -
				(c->maxw == c->minw) && (c->maxh == c->minh));
257 -
258 -
255 +
		c->isfloat = trans
256 +
			|| (c->maxw && c->minw &&
257 +
				c->maxw == c->minw && c->maxh == c->minh)
258 +
			|| (c->w == sw && c->h == sh);
259 259
	settitle(c);
260 260
	arrange(NULL);
261 261
272 272
	int bottom = c->y + c->h;
273 273
	int right = c->x + c->w;
274 274
	XConfigureEvent e;
275 +
	XWindowChanges wc;
275 276
276 277
	if(sizehints) {
277 278
		if(c->incw)
287 288
		if(c->maxh && c->h > c->maxh)
288 289
			c->h = c->maxh;
289 290
	}
290 -
	if(c->x > sw) /* might happen on restart */
291 -
		c->x = sw - c->w;
292 -
	if(c->y > sh)
293 -
		c->y = sh - c->h;
291 +
	if(c->x > right) /* might happen on restart */
292 +
		c->x = right - c->w;
293 +
	if(c->y > bottom)
294 +
		c->y = bottom - c->h;
294 295
	if(sticky == TopRight || sticky == BotRight)
295 296
		c->x = right - c->w;
296 297
	if(sticky == BotLeft || sticky == BotRight)
297 298
		c->y = bottom - c->h;
298 299
299 300
	resizetitle(c);
300 -
	XSetWindowBorderWidth(dpy, c->win, 1);
301 -
	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
301 +
	wc.x = c->x;
302 +
	wc.y = c->y;
303 +
	wc.width = c->w;
304 +
	wc.height = c->h;
305 +
	wc.border_width = 1;
306 +
	XConfigureWindow(dpy, c->win,
307 +
			CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
302 308
303 309
	e.type = ConfigureNotify;
304 310
	e.event = c->win;
event.c +2 −5
175 175
	wc.width = ev->width;
176 176
	wc.height = ev->height;
177 177
	wc.border_width = 1;
178 -
	wc.sibling = None;
179 -
	wc.stack_mode = Above;
180 -
	ev->value_mask &= ~CWStackMode;
181 -
	ev->value_mask |= CWBorderWidth;
182 -
	XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
178 +
	XConfigureWindow(dpy, ev->window,
179 +
			CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
183 180
	XSync(dpy, False);
184 181
}
185 182