mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	opt: optimize minimize state set
This commit is contained in:
		
							parent
							
								
									916ba783ee
								
							
						
					
					
						commit
						0b21761e19
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -93,6 +93,8 @@ static inline void client_activate_surface(struct wlr_surface *s,
 | 
				
			||||||
#ifdef XWAYLAND
 | 
					#ifdef XWAYLAND
 | 
				
			||||||
	struct wlr_xwayland_surface *xsurface;
 | 
						struct wlr_xwayland_surface *xsurface;
 | 
				
			||||||
	if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
 | 
						if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
 | 
				
			||||||
 | 
							if (activated && xsurface->minimized)
 | 
				
			||||||
 | 
								wlr_xwayland_surface_set_minimized(xsurface, false);
 | 
				
			||||||
		wlr_xwayland_surface_activate(xsurface, activated);
 | 
							wlr_xwayland_surface_activate(xsurface, activated);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3366,7 +3366,6 @@ void set_minized(Client *c) {
 | 
				
			||||||
	wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true);
 | 
						wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true);
 | 
				
			||||||
	wl_list_remove(&c->link);				// 从原来位置移除
 | 
						wl_list_remove(&c->link);				// 从原来位置移除
 | 
				
			||||||
	wl_list_insert(clients.prev, &c->link); // 插入尾部
 | 
						wl_list_insert(clients.prev, &c->link); // 插入尾部
 | 
				
			||||||
	client_set_minimized(c, true);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void // 0.5 custom
 | 
					void // 0.5 custom
 | 
				
			||||||
| 
						 | 
					@ -3390,8 +3389,12 @@ minimizenotify(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	if (!c || !c->mon || c->iskilling || c->isminied)
 | 
						if (!c || !c->mon || c->iskilling || c->isminied)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!c->ignore_minimize && client_request_minimize(c, data)) {
 | 
						if (client_request_minimize(c, data)) {
 | 
				
			||||||
 | 
							if (!c->ignore_minimize)
 | 
				
			||||||
			set_minized(c);
 | 
								set_minized(c);
 | 
				
			||||||
 | 
							client_set_minimized(c, true);
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							client_set_minimized(c, false);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4276,7 +4279,6 @@ void show_hide_client(Client *c) {
 | 
				
			||||||
	tag_client(&(Arg){.ui = target}, c);
 | 
						tag_client(&(Arg){.ui = target}, c);
 | 
				
			||||||
	// c->tags = c->oldtags;
 | 
						// c->tags = c->oldtags;
 | 
				
			||||||
	c->isminied = 0;
 | 
						c->isminied = 0;
 | 
				
			||||||
	client_set_minimized(c, false);
 | 
					 | 
				
			||||||
	wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false);
 | 
						wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false);
 | 
				
			||||||
	focusclient(c, 1);
 | 
						focusclient(c, 1);
 | 
				
			||||||
	wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
 | 
						wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue