mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	wlr-seat: selection signal
This commit is contained in:
		
							parent
							
								
									fb25adae36
								
							
						
					
					
						commit
						34f27ff691
					
				
					 3 changed files with 12 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -132,6 +132,8 @@ struct wlr_seat {
 | 
			
		|||
		struct wl_signal keyboard_grab_end;
 | 
			
		||||
 | 
			
		||||
		struct wl_signal request_set_cursor;
 | 
			
		||||
 | 
			
		||||
		struct wl_signal selection;
 | 
			
		||||
	} events;
 | 
			
		||||
 | 
			
		||||
	void *data;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -283,11 +283,16 @@ static void seat_handle_selection_data_source_destroy(
 | 
			
		|||
	struct wlr_seat *seat =
 | 
			
		||||
		wl_container_of(listener, seat, selection_data_source_destroy);
 | 
			
		||||
 | 
			
		||||
	// TODO send null selection to focused keyboard
 | 
			
		||||
	if (seat->keyboard_state.focused_handle &&
 | 
			
		||||
			seat->keyboard_state.focused_surface &&
 | 
			
		||||
			seat->keyboard_state.focused_handle->data_device) {
 | 
			
		||||
		wl_data_device_send_selection(
 | 
			
		||||
			seat->keyboard_state.focused_handle->data_device, NULL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	seat->selection_source = NULL;
 | 
			
		||||
 | 
			
		||||
	// TODO emit selection signal
 | 
			
		||||
	wl_signal_emit(&seat->events.selection, seat);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void wlr_seat_set_selection(struct wlr_seat *seat,
 | 
			
		||||
| 
						 | 
				
			
			@ -313,7 +318,7 @@ void wlr_seat_set_selection(struct wlr_seat *seat,
 | 
			
		|||
		wlr_seat_handle_send_selection(focused_handle);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// TODO emit selection signal
 | 
			
		||||
	wl_signal_emit(&seat->events.selection, seat);
 | 
			
		||||
 | 
			
		||||
	if (source) {
 | 
			
		||||
		seat->selection_data_source_destroy.notify =
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -309,7 +309,9 @@ struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name) {
 | 
			
		|||
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.client_bound);
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.client_unbound);
 | 
			
		||||
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.request_set_cursor);
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.selection);
 | 
			
		||||
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.pointer_grab_begin);
 | 
			
		||||
	wl_signal_init(&wlr_seat->events.pointer_grab_end);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue