mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	opt: optimize focusmon
This commit is contained in:
		
							parent
							
								
									26dc1995d5
								
							
						
					
					
						commit
						2ab0da9cfa
					
				
					 1 changed files with 19 additions and 22 deletions
				
			
		
							
								
								
									
										41
									
								
								maomao.c
									
										
									
									
									
								
							
							
						
						
									
										41
									
								
								maomao.c
									
										
									
									
									
								
							| 
						 | 
					@ -4905,30 +4905,27 @@ void setsmfact(const Arg *arg) {
 | 
				
			||||||
  arrange(selmon, false);
 | 
					  arrange(selmon, false);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void // 0.5
 | 
					void
 | 
				
			||||||
setmon(Client *c, Monitor *m, uint32_t newtags) {
 | 
					setmon(Client *c, Monitor *m, uint32_t newtags)
 | 
				
			||||||
  Monitor *oldmon = c->mon;
 | 
					{
 | 
				
			||||||
 | 
						Monitor *oldmon = c->mon;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (oldmon == m)
 | 
						if (oldmon == m)
 | 
				
			||||||
    return;
 | 
							return;
 | 
				
			||||||
  c->mon = m;
 | 
						c->mon = m;
 | 
				
			||||||
  c->prev = c->geom;
 | 
						c->prev = c->geom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* Scene graph sends surface leave/enter events on move and resize */
 | 
						/* Scene graph sends surface leave/enter events on move and resize */
 | 
				
			||||||
  if (oldmon)
 | 
						if (oldmon)
 | 
				
			||||||
    arrange(oldmon, false);
 | 
							arrange(oldmon,false);
 | 
				
			||||||
  if (m) {
 | 
						if (m) {
 | 
				
			||||||
    /* Make sure window actually overlaps with the monitor */
 | 
							/* Make sure window actually overlaps with the monitor */
 | 
				
			||||||
    resize(c, c->geom, 0);
 | 
							resize(c, c->geom, 0);
 | 
				
			||||||
    c->tags = newtags
 | 
							c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
 | 
				
			||||||
                  ? newtags
 | 
							setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
 | 
				
			||||||
                  : m->tagset[m->seltags]; /* assign tags of target monitor */
 | 
							setfloating(c, c->isfloating);
 | 
				
			||||||
    setfloating(c, c->isfloating);
 | 
						}
 | 
				
			||||||
    setfullscreen(c, c->isfullscreen);     /* This will call arrange(c->mon) */
 | 
						focusclient(focustop(selmon), 1);
 | 
				
			||||||
    if(c && VISIBLEON(c, c->mon))
 | 
					 | 
				
			||||||
      focusclient(c,1);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void // 17
 | 
					void // 17
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue