applied Hiltjo's resize/move limitation 3d1090ba
"Limit the amount of updates when resizing or moving a window in floating
mode to 60 times per second. This makes resizing and moving alot smoother
and by limiting it it also uses alot less resources on my machine.
Anselm R Garbe · 2014-08-11 07:24 2 file(s) · +12 −2
LICENSE +1 −0
1 1
MIT/X Consortium License
2 2
3 3
© 2006-2014 Anselm R Garbe <anselm@garbe.us>
4 +
© 2010-2014 Hiltjo Posthuma <hiltjo@codemadness.org>
4 5
© 2007-2011 Peter Hartlich <sgkkr at hartlich dot com>
5 6
© 2010-2011 Connor Lane Smith <cls@lubutu.com>
6 7
© 2006-2009 Jukka Salmi <jukka at salmi dot ch>
dwm.c +11 −2
1123 1123
	Client *c;
1124 1124
	Monitor *m;
1125 1125
	XEvent ev;
1126 +
	Time lasttime = 0;
1126 1127
1127 1128
	if(!(c = selmon->sel))
1128 1129
		return;
1145 1146
			handler[ev.type](&ev);
1146 1147
			break;
1147 1148
		case MotionNotify:
1149 +
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
1150 +
				continue;
1151 +
			lasttime = ev.xmotion.time;
1152 +
1148 1153
			nx = ocx + (ev.xmotion.x - x);
1149 1154
			ny = ocy + (ev.xmotion.y - y);
1150 1155
			if(nx >= selmon->wx && nx <= selmon->wx + selmon->ww
1264 1269
1265 1270
void
1266 1271
resizemouse(const Arg *arg) {
1267 -
	int ocx, ocy;
1268 -
	int nw, nh;
1272 +
	int ocx, ocy, nw, nh;
1269 1273
	Client *c;
1270 1274
	Monitor *m;
1271 1275
	XEvent ev;
1276 +
	Time lasttime = 0;
1272 1277
1273 1278
	if(!(c = selmon->sel))
1274 1279
		return;
1290 1295
			handler[ev.type](&ev);
1291 1296
			break;
1292 1297
		case MotionNotify:
1298 +
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
1299 +
				continue;
1300 +
			lasttime = ev.xmotion.time;
1301 +
1293 1302
			nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
1294 1303
			nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
1295 1304
			if(c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww