about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authoranselm@anselm1 <unknown>2007-12-22 12:49:04 +0000
committeranselm@anselm1 <unknown>2007-12-22 12:49:04 +0000
commit7a496e9777f2656987ba86dbba1e87a46a483fac (patch)
treea3ce9d4fd881b04c3d8aa187b4b0104da1d147dd
parent308f95ae5ad6c00fcf15aa26481a9962ceabb796 (diff)
downloaddwm-7a496e9777f2656987ba86dbba1e87a46a483fac.tar.gz
fixed wrong tagging stuff
-rw-r--r--config.def.h2
-rw-r--r--dwm.c26
2 files changed, 14 insertions, 14 deletions
diff --git a/config.def.h b/config.def.h
index dedcc61..3cb562a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,7 +13,7 @@
 
 /* tagging */
 const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "www" };
-Bool seltags[LENGTH(tags)] = {[0] = True};
+Bool initags[LENGTH(tags)] = {[0] = True};
 Rule rules[] = {
 	/* class:instance:title regex	tags regex	isfloating */
 	{ "Firefox",			"www",		False },
diff --git a/dwm.c b/dwm.c
index fb6bcb8..547218a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -297,7 +297,7 @@ applyrules(Client *c) {
 	if(ch.res_name)
 		XFree(ch.res_name);
 	if(!matched_tag)
-		memcpy(c->tags, monitors[monitorat(-1, -1)].seltags, sizeof seltags);
+		memcpy(c->tags, monitors[monitorat(-1, -1)].seltags, sizeof initags);
 	if (!matched_monitor)
 		c->monitor = monitorat(-1, -1);
 }
@@ -1056,7 +1056,7 @@ manage(Window w, XWindowAttributes *wa) {
 	XWindowChanges wc;
 
 	c = emallocz(sizeof(Client));
-	c->tags = emallocz(sizeof seltags);
+	c->tags = emallocz(sizeof initags);
 	c->win = w;
 
 	applyrules(c);
@@ -1100,7 +1100,7 @@ manage(Window w, XWindowAttributes *wa) {
 	if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
 		for(t = clients; t && t->win != trans; t = t->next);
 	if(t)
-		memcpy(c->tags, t->tags, sizeof seltags);
+		memcpy(c->tags, t->tags, sizeof initags);
 	if(!c->isfloating)
 		c->isfloating = (rettrans == Success) || c->isfixed;
 	attach(c);
@@ -1181,7 +1181,7 @@ movemouse(Client *c) {
 			else if(abs((m->way + m->wah) - (ny + c->h + 2 * c->border)) < SNAP)
 				ny = m->way + m->wah - c->h - 2 * c->border;
 			resize(c, nx, ny, c->w, c->h, False);
-			memcpy(c->tags, monitors[monitorat(nx, ny)].seltags, sizeof seltags);
+			memcpy(c->tags, monitors[monitorat(nx, ny)].seltags, sizeof initags);
 			break;
 		}
 	}
@@ -1591,11 +1591,11 @@ setup(void) {
 		}
 
 		monitors[i].id = i;
-		monitors[i].seltags = emallocz(LENGTH(tags)*sizeof(char*));
-		monitors[i].prevtags = emallocz(LENGTH(tags)*sizeof(char*));
+		monitors[i].seltags = emallocz(sizeof initags);
+		monitors[i].prevtags = emallocz(sizeof initags);
 
-		memcpy(monitors[i].seltags, seltags, sizeof seltags);
-		memcpy(monitors[i].prevtags, seltags, sizeof seltags);
+		memcpy(monitors[i].seltags, initags, sizeof initags);
+		memcpy(monitors[i].prevtags, initags, sizeof initags);
 
 		/* init appearance */
 		monitors[i].dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR);
@@ -1950,7 +1950,7 @@ view(const char *arg) {
 
 	Monitor *m = &monitors[monitorat(-1, -1)];
 
-	memcpy(m->prevtags, seltags, sizeof seltags);
+	memcpy(m->prevtags, m->seltags, sizeof initags);
 	for(i = 0; i < LENGTH(tags); i++)
 		m->seltags[i] = (NULL == arg);
 	m->seltags[idxoftag(arg)] = True;
@@ -1963,9 +1963,9 @@ viewprevtag(const char *arg) {
 
 	Monitor *m = &monitors[monitorat(-1, -1)];
 
-	memcpy(tmp, m->seltags, sizeof seltags);
-	memcpy(m->seltags, m->prevtags, sizeof seltags);
-	memcpy(m->prevtags, tmp, sizeof seltags);
+	memcpy(tmp, m->seltags, sizeof initags);
+	memcpy(m->seltags, m->prevtags, sizeof initags);
+	memcpy(m->prevtags, tmp, sizeof initags);
 	arrange();
 }
 
@@ -2011,7 +2011,7 @@ movetomonitor(const char *arg) {
 	if (sel) {
 		sel->monitor = arg ? atoi(arg) : (sel->monitor+1) % mcount;
 
-		memcpy(sel->tags, monitors[sel->monitor].seltags, sizeof seltags);
+		memcpy(sel->tags, monitors[sel->monitor].seltags, sizeof initags);
 		resize(sel, monitors[sel->monitor].wax, monitors[sel->monitor].way, sel->w, sel->h, True);
 		arrange();
 	}
06' href='#n306'>306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455