mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	data-device: Handle setting a NULL selection source
This commit is contained in:
		
							parent
							
								
									0527ad8f00
								
							
						
					
					
						commit
						0760297633
					
				
					 1 changed files with 9 additions and 5 deletions
				
			
		| 
						 | 
					@ -388,19 +388,23 @@ wl_seat_set_selection(struct wl_seat *seat, struct wl_data_source *source,
 | 
				
			||||||
	if (focus) {
 | 
						if (focus) {
 | 
				
			||||||
		data_device = find_resource(&seat->drag_resource_list,
 | 
							data_device = find_resource(&seat->drag_resource_list,
 | 
				
			||||||
					    focus->client);
 | 
										    focus->client);
 | 
				
			||||||
		if (data_device) {
 | 
							if (data_device && source) {
 | 
				
			||||||
			offer = wl_data_source_send_offer(seat->selection_data_source,
 | 
								offer = wl_data_source_send_offer(seat->selection_data_source,
 | 
				
			||||||
							  data_device);
 | 
												  data_device);
 | 
				
			||||||
			wl_data_device_send_selection(data_device, offer);
 | 
								wl_data_device_send_selection(data_device, offer);
 | 
				
			||||||
 | 
							} else if (data_device) {
 | 
				
			||||||
 | 
								wl_data_device_send_selection(data_device, NULL);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_signal_emit(&seat->selection_signal, seat);
 | 
						wl_signal_emit(&seat->selection_signal, seat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	seat->selection_data_source_listener.notify =
 | 
						if (source) {
 | 
				
			||||||
		destroy_selection_data_source;
 | 
							seat->selection_data_source_listener.notify =
 | 
				
			||||||
	wl_signal_add(&source->resource.destroy_signal,
 | 
								destroy_selection_data_source;
 | 
				
			||||||
		      &seat->selection_data_source_listener);
 | 
							wl_signal_add(&source->resource.destroy_signal,
 | 
				
			||||||
 | 
								      &seat->selection_data_source_listener);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue