mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	opt: optimize scroller_prefer_center judge when kill a client
This commit is contained in:
		
							parent
							
								
									c23c74627f
								
							
						
					
					
						commit
						1418fda1f2
					
				
					 2 changed files with 10 additions and 8 deletions
				
			
		| 
						 | 
					@ -392,10 +392,11 @@ void scroller(Monitor *m) {
 | 
				
			||||||
	if (need_scroller) {
 | 
						if (need_scroller) {
 | 
				
			||||||
		if (scroller_focus_center ||
 | 
							if (scroller_focus_center ||
 | 
				
			||||||
			((!m->prevsel ||
 | 
								((!m->prevsel ||
 | 
				
			||||||
 | 
								  (ISTILED(m->prevsel) &&
 | 
				
			||||||
			   (m->prevsel->scroller_proportion * max_client_width) +
 | 
								   (m->prevsel->scroller_proportion * max_client_width) +
 | 
				
			||||||
					   (root_client->scroller_proportion * max_client_width) >
 | 
										   (root_client->scroller_proportion * max_client_width) >
 | 
				
			||||||
				  m->w.width - 2 * scroller_structs - cur_gappih) &&
 | 
									   m->w.width - 2 * scroller_structs - cur_gappih)) &&
 | 
				
			||||||
			 ISTILED(m->prevsel) && scroller_prefer_center)) {
 | 
								 scroller_prefer_center)) {
 | 
				
			||||||
			target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
 | 
								target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			target_geom.x = root_client->geom.x > m->w.x + (m->w.width) / 2
 | 
								target_geom.x = root_client->geom.x > m->w.x + (m->w.width) / 2
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -379,10 +379,11 @@ void vertical_scroller(Monitor *m) {
 | 
				
			||||||
	if (need_scroller) {
 | 
						if (need_scroller) {
 | 
				
			||||||
		if (scroller_focus_center ||
 | 
							if (scroller_focus_center ||
 | 
				
			||||||
			((!m->prevsel ||
 | 
								((!m->prevsel ||
 | 
				
			||||||
 | 
								  (ISTILED(m->prevsel) &&
 | 
				
			||||||
			   (m->prevsel->scroller_proportion * max_client_height) +
 | 
								   (m->prevsel->scroller_proportion * max_client_height) +
 | 
				
			||||||
					   (root_client->scroller_proportion * max_client_height) >
 | 
										   (root_client->scroller_proportion * max_client_height) >
 | 
				
			||||||
				  m->w.height - 2 * scroller_structs - cur_gappiv) &&
 | 
									   m->w.height - 2 * scroller_structs - cur_gappiv)) &&
 | 
				
			||||||
			 ISTILED(m->prevsel) && scroller_prefer_center)) {
 | 
								 scroller_prefer_center)) {
 | 
				
			||||||
			target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2;
 | 
								target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			target_geom.y = root_client->geom.y > m->w.y + (m->w.height) / 2
 | 
								target_geom.y = root_client->geom.y > m->w.y + (m->w.height) / 2
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue