mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-10-29 05:40:16 -04:00 
			
		
		
		
	server: check visibility before sending global/global_remove
See the previous discussion at [1]: libwayland incorrectly skips the visibility checks when sending global/global_remove events. The check is only performed when a client performs a wl_display.get_registry request. [1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/148 Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
		
							parent
							
								
									dd00220b1e
								
							
						
					
					
						commit
						1b00df864c
					
				
					 1 changed files with 9 additions and 7 deletions
				
			
		|  | @ -1252,11 +1252,12 @@ wl_global_create(struct wl_display *display, | |||
| 	wl_list_insert(display->global_list.prev, &global->link); | ||||
| 
 | ||||
| 	wl_list_for_each(resource, &display->registry_resource_list, link) | ||||
| 		wl_resource_post_event(resource, | ||||
| 				       WL_REGISTRY_GLOBAL, | ||||
| 				       global->name, | ||||
| 				       global->interface->name, | ||||
| 				       global->version); | ||||
| 		if (wl_global_is_visible(resource->client, global)) | ||||
| 			wl_resource_post_event(resource, | ||||
| 					       WL_REGISTRY_GLOBAL, | ||||
| 					       global->name, | ||||
| 					       global->interface->name, | ||||
| 					       global->version); | ||||
| 
 | ||||
| 	return global; | ||||
| } | ||||
|  | @ -1294,8 +1295,9 @@ wl_global_remove(struct wl_global *global) | |||
| 			 global->name); | ||||
| 
 | ||||
| 	wl_list_for_each(resource, &display->registry_resource_list, link) | ||||
| 		wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, | ||||
| 				       global->name); | ||||
| 		if (wl_global_is_visible(resource->client, global)) | ||||
| 			wl_resource_post_event(resource, WL_REGISTRY_GLOBAL_REMOVE, | ||||
| 					       global->name); | ||||
| 
 | ||||
| 	global->removed = true; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Ser
						Simon Ser