mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	server: Post new globals to current clients
Globals are bursted to client on conntect. Now when new global objects are added to the server state, existing clients also get notified.
This commit is contained in:
		
							parent
							
								
									5177e76984
								
							
						
					
					
						commit
						c1b6dbbacd
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -838,6 +838,7 @@ wl_display_add_global(struct wl_display *display,
 | 
			
		|||
		      void *data, wl_global_bind_func_t bind)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_global *global;
 | 
			
		||||
	struct wl_client *client;
 | 
			
		||||
 | 
			
		||||
	global = malloc(sizeof *global);
 | 
			
		||||
	if (global == NULL)
 | 
			
		||||
| 
						 | 
				
			
			@ -849,6 +850,13 @@ wl_display_add_global(struct wl_display *display,
 | 
			
		|||
	global->bind = bind;
 | 
			
		||||
	wl_list_insert(display->global_list.prev, &global->link);
 | 
			
		||||
 | 
			
		||||
	wl_list_for_each(client, &display->client_list, link)
 | 
			
		||||
		wl_resource_post_event(client->display_resource,
 | 
			
		||||
				       WL_DISPLAY_GLOBAL,
 | 
			
		||||
				       global->name,
 | 
			
		||||
				       global->interface->name,
 | 
			
		||||
				       global->interface->version);
 | 
			
		||||
 | 
			
		||||
	return global;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue