mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	compositor: add surface role map hook
This commit is contained in:
		
							parent
							
								
									515275ee72
								
							
						
					
					
						commit
						a1298580cc
					
				
					 2 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
					@ -97,6 +97,13 @@ struct wlr_surface_role {
 | 
				
			||||||
	 * such object exists.
 | 
						 * such object exists.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	void (*commit)(struct wlr_surface *surface);
 | 
						void (*commit)(struct wlr_surface *surface);
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Called when the surface is mapped. May be NULL.
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * If the role is represented by an object, this is only called if
 | 
				
			||||||
 | 
						 * such object exists.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						void (*map)(struct wlr_surface *surface);
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Called when the surface is unmapped. May be NULL.
 | 
						 * Called when the surface is unmapped. May be NULL.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -828,6 +828,11 @@ void wlr_surface_map(struct wlr_surface *surface) {
 | 
				
			||||||
		subsurface_consider_map(subsurface);
 | 
							subsurface_consider_map(subsurface);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (surface->role != NULL && surface->role->map != NULL &&
 | 
				
			||||||
 | 
								(surface->role_resource != NULL || surface->role->no_object)) {
 | 
				
			||||||
 | 
							surface->role->map(surface);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_signal_emit_mutable(&surface->events.map, NULL);
 | 
						wl_signal_emit_mutable(&surface->events.map, NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue