mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	data-control-v1: handle NULL sources in set_selection
This commit is contained in:
		
							parent
							
								
									209210d307
								
							
						
					
					
						commit
						5fdf22b5d3
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -177,11 +177,15 @@ static void control_handle_set_selection(struct wl_client *client,
 | 
			
		|||
		struct wl_resource *source_resource) {
 | 
			
		||||
	struct wlr_data_control_device_v1 *device =
 | 
			
		||||
		control_from_resource(control_resource);
 | 
			
		||||
	struct client_data_source *source = source_from_resource(source_resource);
 | 
			
		||||
	if (device == NULL) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	struct client_data_source *source = NULL;
 | 
			
		||||
	if (source_resource != NULL) {
 | 
			
		||||
		source = source_from_resource(source_resource);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	struct wlr_data_source *wlr_source = source ? &source->source : NULL;
 | 
			
		||||
	wlr_seat_request_set_selection(device->seat, wlr_source,
 | 
			
		||||
		wl_display_next_serial(device->seat->display));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue