vanitygaps: PERTAG_VANITYGAPS_PATCH to control both gaps and whether gaps are enabled per tag ref. #147
This commit is contained in:
		
							
								
								
									
										6
									
								
								dwm.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								dwm.c
									
									
									
									
									
								
							| @@ -1653,13 +1653,11 @@ createmon(void) | |||||||
| 		#endif // MONITOR_RULES_PATCH | 		#endif // MONITOR_RULES_PATCH | ||||||
| 		m->pertag->sellts[i] = m->sellt; | 		m->pertag->sellts[i] = m->sellt; | ||||||
|  |  | ||||||
| 		#if VANITYGAPS_PATCH | 		#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH | ||||||
| 		m->pertag->enablegaps[i] = 1; | 		m->pertag->enablegaps[i] = 1; | ||||||
| 		#if PERTAG_VANITYGAPS_PATCH |  | ||||||
| 		m->pertag->gaps[i] = | 		m->pertag->gaps[i] = | ||||||
| 			((gappoh & 0xFF) << 0) | ((gappov & 0xFF) << 8) | ((gappih & 0xFF) << 16) | ((gappiv & 0xFF) << 24); | 			((gappoh & 0xFF) << 0) | ((gappov & 0xFF) << 8) | ((gappih & 0xFF) << 16) | ((gappiv & 0xFF) << 24); | ||||||
| 		#endif // PERTAG_VANITYGAPS_PATCH | 		#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH | ||||||
| 		#endif // VANITYGAPS_PATCH |  | ||||||
| 	} | 	} | ||||||
| 	#endif // PERTAG_PATCH | 	#endif // PERTAG_PATCH | ||||||
| 	#if INSETS_PATCH | 	#if INSETS_PATCH | ||||||
|   | |||||||
| @@ -19,10 +19,8 @@ struct Pertag { | |||||||
| 	#if ZOOMSWAP_PATCH | 	#if ZOOMSWAP_PATCH | ||||||
| 	Client *prevzooms[NUMTAGS + 1]; /* store zoom information */ | 	Client *prevzooms[NUMTAGS + 1]; /* store zoom information */ | ||||||
| 	#endif // ZOOMSWAP_PATCH | 	#endif // ZOOMSWAP_PATCH | ||||||
| 	#if VANITYGAPS_PATCH |  | ||||||
| 	int enablegaps[NUMTAGS + 1]; |  | ||||||
| 	#endif // VANITYGAPS_PATCH |  | ||||||
| 	#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH | 	#if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH | ||||||
|  | 	int enablegaps[NUMTAGS + 1]; | ||||||
| 	unsigned int gaps[NUMTAGS + 1]; | 	unsigned int gaps[NUMTAGS + 1]; | ||||||
| 	#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH | 	#endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| /* Settings */ | /* Settings */ | ||||||
| #if !PERTAG_VANITYGAPS_PATCH || !PERTAG_PATCH | #if !PERTAG_VANITYGAPS_PATCH | ||||||
| static int enablegaps = 1; | static int enablegaps = 1; | ||||||
| #endif // PERTAG_VANITYGAPS_PATCH | PERTAG_PATCH | #endif // PERTAG_VANITYGAPS_PATCH | ||||||
|  |  | ||||||
| static void | static void | ||||||
| setgaps(int oh, int ov, int ih, int iv) | setgaps(int oh, int ov, int ih, int iv) | ||||||
| @@ -19,7 +19,7 @@ setgaps(int oh, int ov, int ih, int iv) | |||||||
| 	#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH | 	#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH | ||||||
| 	selmon->pertag->gaps[selmon->pertag->curtag] = | 	selmon->pertag->gaps[selmon->pertag->curtag] = | ||||||
| 		((oh & 0xFF) << 0) | ((ov & 0xFF) << 8) | ((ih & 0xFF) << 16) | ((iv & 0xFF) << 24); | 		((oh & 0xFF) << 0) | ((ov & 0xFF) << 8) | ((ih & 0xFF) << 16) | ((iv & 0xFF) << 24); | ||||||
| 	#endif // PERTAG_VANITYGAPS_PATCH | PERTAG_PATCH | 	#endif // PERTAG_VANITYGAPS_PATCH | ||||||
|  |  | ||||||
| 	arrange(selmon); | 	arrange(selmon); | ||||||
| } | } | ||||||
| @@ -72,7 +72,7 @@ setgapsex(const Arg *arg) | |||||||
| 	#else | 	#else | ||||||
| 	if (!enablegaps) | 	if (!enablegaps) | ||||||
| 		enablegaps = 1; | 		enablegaps = 1; | ||||||
| 	#endif // PERTAG_VANITYGAPS_PATCH | PERTAG_PATCH | 	#endif // PERTAG_VANITYGAPS_PATCH | ||||||
|  |  | ||||||
| 	setgaps(oh, ov, ih, iv); | 	setgaps(oh, ov, ih, iv); | ||||||
| } | } | ||||||
| @@ -85,7 +85,7 @@ togglegaps(const Arg *arg) | |||||||
| 	selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag]; | 	selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag]; | ||||||
| 	#else | 	#else | ||||||
| 	enablegaps = !enablegaps; | 	enablegaps = !enablegaps; | ||||||
| 	#endif // PERTAG_VANITYGAPS_PATCH | PERTAG_PATCH | 	#endif // PERTAG_VANITYGAPS_PATCH | ||||||
| 	arrange(NULL); | 	arrange(NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -177,11 +177,11 @@ static void | |||||||
| getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) | getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) | ||||||
| { | { | ||||||
| 	unsigned int n, oe, ie; | 	unsigned int n, oe, ie; | ||||||
| 	#if PERTAG_PATCH | 	#if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH | ||||||
| 	oe = ie = selmon->pertag->enablegaps[selmon->pertag->curtag]; | 	oe = ie = selmon->pertag->enablegaps[selmon->pertag->curtag]; | ||||||
| 	#else | 	#else | ||||||
| 	oe = ie = enablegaps; | 	oe = ie = enablegaps; | ||||||
| 	#endif // PERTAG_PATCH | 	#endif // PERTAG_VANITYGAPS_PATCH | ||||||
| 	Client *c; | 	Client *c; | ||||||
|  |  | ||||||
| 	for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); | 	for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user