seat: rename selection_source to selection_data_source, remove unused data_device
This commit is contained in:
		
							parent
							
								
									720c1154dc
								
							
						
					
					
						commit
						38ed3b4245
					
				|  | @ -178,8 +178,7 @@ struct wlr_seat { | ||||||
| 	uint32_t capabilities; | 	uint32_t capabilities; | ||||||
| 	struct timespec last_event; | 	struct timespec last_event; | ||||||
| 
 | 
 | ||||||
| 	struct wlr_data_device *data_device; // TODO needed?
 | 	struct wlr_data_source *selection_data_source; | ||||||
| 	struct wlr_data_source *selection_source; |  | ||||||
| 	uint32_t selection_serial; | 	uint32_t selection_serial; | ||||||
| 
 | 
 | ||||||
| 	struct wlr_primary_selection_source *primary_selection_source; | 	struct wlr_primary_selection_source *primary_selection_source; | ||||||
|  |  | ||||||
|  | @ -253,9 +253,9 @@ void wlr_seat_client_send_selection(struct wlr_seat_client *seat_client) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (seat_client->seat->selection_source) { | 	if (seat_client->seat->selection_data_source) { | ||||||
| 		struct wlr_data_offer *offer = wlr_data_source_send_offer( | 		struct wlr_data_offer *offer = wlr_data_source_send_offer( | ||||||
| 			seat_client->seat->selection_source, seat_client); | 			seat_client->seat->selection_data_source, seat_client); | ||||||
| 		if (offer == NULL) { | 		if (offer == NULL) { | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
|  | @ -285,7 +285,7 @@ static void seat_client_selection_data_source_destroy( | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	seat->selection_source = NULL; | 	seat->selection_data_source = NULL; | ||||||
| 
 | 
 | ||||||
| 	wl_signal_emit(&seat->events.selection, seat); | 	wl_signal_emit(&seat->events.selection, seat); | ||||||
| } | } | ||||||
|  | @ -297,18 +297,18 @@ void wlr_seat_set_selection(struct wlr_seat *seat, | ||||||
| 		assert(source->cancel); | 		assert(source->cancel); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (seat->selection_source && | 	if (seat->selection_data_source && | ||||||
| 			seat->selection_serial - serial < UINT32_MAX / 2) { | 			seat->selection_serial - serial < UINT32_MAX / 2) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (seat->selection_source) { | 	if (seat->selection_data_source) { | ||||||
| 		seat->selection_source->cancel(seat->selection_source); | 		seat->selection_data_source->cancel(seat->selection_data_source); | ||||||
| 		seat->selection_source = NULL; | 		seat->selection_data_source = NULL; | ||||||
| 		wl_list_remove(&seat->selection_data_source_destroy.link); | 		wl_list_remove(&seat->selection_data_source_destroy.link); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	seat->selection_source = source; | 	seat->selection_data_source = source; | ||||||
| 	seat->selection_serial = serial; | 	seat->selection_serial = serial; | ||||||
| 
 | 
 | ||||||
| 	struct wlr_seat_client *focused_client = | 	struct wlr_seat_client *focused_client = | ||||||
|  |  | ||||||
|  | @ -352,9 +352,9 @@ void wlr_seat_destroy(struct wlr_seat *seat) { | ||||||
| 
 | 
 | ||||||
| 	wl_list_remove(&seat->display_destroy.link); | 	wl_list_remove(&seat->display_destroy.link); | ||||||
| 
 | 
 | ||||||
| 	if (seat->selection_source) { | 	if (seat->selection_data_source) { | ||||||
| 		seat->selection_source->cancel(seat->selection_source); | 		seat->selection_data_source->cancel(seat->selection_data_source); | ||||||
| 		seat->selection_source = NULL; | 		seat->selection_data_source = NULL; | ||||||
| 		wl_list_remove(&seat->selection_data_source_destroy.link); | 		wl_list_remove(&seat->selection_data_source_destroy.link); | ||||||
| 	} | 	} | ||||||
| 	if (seat->primary_selection_source) { | 	if (seat->primary_selection_source) { | ||||||
|  | @ -373,7 +373,6 @@ void wlr_seat_destroy(struct wlr_seat *seat) { | ||||||
| 	free(seat->pointer_state.default_grab); | 	free(seat->pointer_state.default_grab); | ||||||
| 	free(seat->keyboard_state.default_grab); | 	free(seat->keyboard_state.default_grab); | ||||||
| 	free(seat->touch_state.default_grab); | 	free(seat->touch_state.default_grab); | ||||||
| 	free(seat->data_device); |  | ||||||
| 	free(seat->name); | 	free(seat->name); | ||||||
| 	free(seat); | 	free(seat); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -153,7 +153,8 @@ error_out: | ||||||
| static void xwm_selection_source_send(struct wlr_xwm_selection *selection, | static void xwm_selection_source_send(struct wlr_xwm_selection *selection, | ||||||
| 		const char *mime_type, int32_t fd) { | 		const char *mime_type, int32_t fd) { | ||||||
| 	if (selection == &selection->xwm->clipboard_selection) { | 	if (selection == &selection->xwm->clipboard_selection) { | ||||||
| 		struct wlr_data_source *source = selection->xwm->seat->selection_source; | 		struct wlr_data_source *source = | ||||||
|  | 			selection->xwm->seat->selection_data_source; | ||||||
| 		if (source != NULL) { | 		if (source != NULL) { | ||||||
| 			source->send(source, mime_type, fd); | 			source->send(source, mime_type, fd); | ||||||
| 			return; | 			return; | ||||||
|  | @ -214,7 +215,8 @@ static void xwm_selection_send_timestamp(struct wlr_xwm_selection *selection) { | ||||||
| static struct wl_array *xwm_selection_source_get_mime_types( | static struct wl_array *xwm_selection_source_get_mime_types( | ||||||
| 		struct wlr_xwm_selection *selection) { | 		struct wlr_xwm_selection *selection) { | ||||||
| 	if (selection == &selection->xwm->clipboard_selection) { | 	if (selection == &selection->xwm->clipboard_selection) { | ||||||
| 		struct wlr_data_source *source = selection->xwm->seat->selection_source; | 		struct wlr_data_source *source = | ||||||
|  | 			selection->xwm->seat->selection_data_source; | ||||||
| 		if (source != NULL) { | 		if (source != NULL) { | ||||||
| 			return &source->mime_types; | 			return &source->mime_types; | ||||||
| 		} | 		} | ||||||
|  | @ -834,8 +836,8 @@ void xwm_selection_finish(struct wlr_xwm *xwm) { | ||||||
| 		xcb_destroy_window(xwm->xcb_conn, xwm->selection_window); | 		xcb_destroy_window(xwm->xcb_conn, xwm->selection_window); | ||||||
| 	} | 	} | ||||||
| 	if (xwm->seat) { | 	if (xwm->seat) { | ||||||
| 		if (xwm->seat->selection_source && | 		if (xwm->seat->selection_data_source && | ||||||
| 				xwm->seat->selection_source->cancel == data_source_cancel) { | 				xwm->seat->selection_data_source->cancel == data_source_cancel) { | ||||||
| 			wlr_seat_set_selection(xwm->seat, NULL, | 			wlr_seat_set_selection(xwm->seat, NULL, | ||||||
| 					wl_display_next_serial(xwm->xwayland->wl_display)); | 					wl_display_next_serial(xwm->xwayland->wl_display)); | ||||||
| 		} | 		} | ||||||
|  | @ -871,7 +873,7 @@ static void seat_handle_selection(struct wl_listener *listener, | ||||||
| 	struct wlr_seat *seat = data; | 	struct wlr_seat *seat = data; | ||||||
| 	struct wlr_xwm *xwm = | 	struct wlr_xwm *xwm = | ||||||
| 		wl_container_of(listener, xwm, seat_selection); | 		wl_container_of(listener, xwm, seat_selection); | ||||||
| 	struct wlr_data_source *source = seat->selection_source; | 	struct wlr_data_source *source = seat->selection_data_source; | ||||||
| 
 | 
 | ||||||
| 	if (source != NULL && source->send == data_source_send) { | 	if (source != NULL && source->send == data_source_send) { | ||||||
| 		return; | 		return; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue