diff options
-rw-r--r-- | include/xwayland/selection.h | 8 | ||||
-rw-r--r-- | xwayland/selection/incoming.c | 18 | ||||
-rw-r--r-- | xwayland/selection/outgoing.c | 18 | ||||
-rw-r--r-- | xwayland/selection/selection.c | 16 |
4 files changed, 30 insertions, 30 deletions
diff --git a/include/xwayland/selection.h b/include/xwayland/selection.h index 67a23e81..c0bae533 100644 --- a/include/xwayland/selection.h +++ b/include/xwayland/selection.h @@ -18,8 +18,8 @@ struct wlr_xwm_selection_transfer { bool flush_property_on_delete; bool property_set; struct wl_array source_data; - int source_fd; - struct wl_event_source *source; + int wl_client_fd; + struct wl_event_source *event_source; // when sending to x11 xcb_selection_request_event_t request; @@ -41,9 +41,9 @@ struct wlr_xwm_selection { struct wl_list outgoing; }; -void xwm_selection_transfer_remove_source( +void xwm_selection_transfer_remove_event_source( struct wlr_xwm_selection_transfer *transfer); -void xwm_selection_transfer_close_source_fd( +void xwm_selection_transfer_close_wl_client_fd( struct wlr_xwm_selection_transfer *transfer); void xwm_selection_transfer_destroy_property_reply( struct wlr_xwm_selection_transfer *transfer); diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c index 257cccf1..db39ae75 100644 --- a/xwayland/selection/incoming.c +++ b/xwayland/selection/incoming.c @@ -26,8 +26,8 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) { if (len == -1) { wlr_log_errno(WLR_ERROR, "write error to target fd %d", fd); xwm_selection_transfer_destroy_property_reply(transfer); - xwm_selection_transfer_remove_source(transfer); - xwm_selection_transfer_close_source_fd(transfer); + xwm_selection_transfer_remove_event_source(transfer); + xwm_selection_transfer_close_wl_client_fd(transfer); return 1; } @@ -38,7 +38,7 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) { transfer->property_start += len; if (len == remainder) { xwm_selection_transfer_destroy_property_reply(transfer); - xwm_selection_transfer_remove_source(transfer); + xwm_selection_transfer_remove_event_source(transfer); if (transfer->incr) { wlr_log(WLR_DEBUG, "deleting property"); @@ -47,7 +47,7 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) { xcb_flush(xwm->xcb_conn); } else { wlr_log(WLR_DEBUG, "transfer complete"); - xwm_selection_transfer_close_source_fd(transfer); + xwm_selection_transfer_close_wl_client_fd(transfer); } } @@ -61,13 +61,13 @@ static void xwm_write_property(struct wlr_xwm_selection_transfer *transfer, transfer->property_start = 0; transfer->property_reply = reply; - xwm_data_source_write(transfer->source_fd, WL_EVENT_WRITABLE, transfer); + xwm_data_source_write(transfer->wl_client_fd, WL_EVENT_WRITABLE, transfer); if (transfer->property_reply != NULL) { struct wl_event_loop *loop = wl_display_get_event_loop(xwm->xwayland->wl_display); - transfer->source = wl_event_loop_add_fd(loop, - transfer->source_fd, WL_EVENT_WRITABLE, xwm_data_source_write, + transfer->event_source = wl_event_loop_add_fd(loop, + transfer->wl_client_fd, WL_EVENT_WRITABLE, xwm_data_source_write, transfer); } } @@ -99,7 +99,7 @@ void xwm_get_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { xwm_write_property(transfer, reply); } else { wlr_log(WLR_DEBUG, "transfer complete"); - xwm_selection_transfer_close_source_fd(transfer); + xwm_selection_transfer_close_wl_client_fd(transfer); free(reply); } } @@ -172,7 +172,7 @@ static void source_send(struct wlr_xwm_selection *selection, xcb_flush(xwm->xcb_conn); fcntl(fd, F_SETFL, O_WRONLY | O_NONBLOCK); - transfer->source_fd = fd; + transfer->wl_client_fd = fd; } struct x11_data_source { diff --git a/xwayland/selection/outgoing.c b/xwayland/selection/outgoing.c index a5ce2fd2..8d011729 100644 --- a/xwayland/selection/outgoing.c +++ b/xwayland/selection/outgoing.c @@ -80,8 +80,8 @@ static void xwm_selection_transfer_destroy_outgoing( xwm_selection_transfer_get_first(selection)); } - xwm_selection_transfer_remove_source(transfer); - xwm_selection_transfer_close_source_fd(transfer); + xwm_selection_transfer_remove_event_source(transfer); + xwm_selection_transfer_close_wl_client_fd(transfer); wl_array_release(&transfer->source_data); free(transfer); } @@ -129,14 +129,14 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { transfer->incr = true; transfer->property_set = true; transfer->flush_property_on_delete = true; - xwm_selection_transfer_remove_source(transfer); + xwm_selection_transfer_remove_event_source(transfer); xwm_selection_send_notify(xwm, &transfer->request, true); } else if (transfer->property_set) { wlr_log(WLR_DEBUG, "got %zu bytes, waiting for property delete", transfer->source_data.size); transfer->flush_property_on_delete = true; - xwm_selection_transfer_remove_source(transfer); + xwm_selection_transfer_remove_event_source(transfer); } else { wlr_log(WLR_DEBUG, "got %zu bytes, property deleted, setting new " "property", transfer->source_data.size); @@ -159,8 +159,8 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) { "property", transfer->source_data.size); xwm_selection_flush_source_data(transfer); } - xwm_selection_transfer_remove_source(transfer); - xwm_selection_transfer_close_source_fd(transfer); + xwm_selection_transfer_remove_event_source(transfer); + xwm_selection_transfer_close_wl_client_fd(transfer); } else { wlr_log(WLR_DEBUG, "nothing happened, buffered the bytes"); } @@ -183,7 +183,7 @@ void xwm_send_incr_chunk(struct wlr_xwm_selection_transfer *transfer) { transfer->flush_property_on_delete = false; int length = xwm_selection_flush_source_data(transfer); - if (transfer->source_fd >= 0) { + if (transfer->wl_client_fd >= 0) { xwm_selection_transfer_start_outgoing(transfer); } else if (length > 0) { /* Transfer is all done, but queue a flush for @@ -234,7 +234,7 @@ static void xwm_selection_transfer_start_outgoing( wl_display_get_event_loop(xwm->xwayland->wl_display); wlr_log(WLR_DEBUG, "Starting transfer %p", transfer); assert(transfer == xwm_selection_transfer_get_first(transfer->selection)); - transfer->source = wl_event_loop_add_fd(loop, transfer->source_fd, + transfer->event_source = wl_event_loop_add_fd(loop, transfer->wl_client_fd, WL_EVENT_READABLE, xwm_data_source_read, transfer); } @@ -312,7 +312,7 @@ static bool xwm_selection_send_data(struct wlr_xwm_selection *selection, fcntl(p[1], F_SETFD, FD_CLOEXEC); fcntl(p[1], F_SETFL, O_NONBLOCK); - transfer->source_fd = p[0]; + transfer->wl_client_fd = p[0]; wlr_log(WLR_DEBUG, "Sending Wayland selection %u to Xwayland window with " "MIME type %s, target %u, transfer %p", req->target, mime_type, diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c index a8cb5df4..d27e0507 100644 --- a/xwayland/selection/selection.c +++ b/xwayland/selection/selection.c @@ -11,19 +11,19 @@ #include "xwayland/selection.h" #include "xwayland/xwm.h" -void xwm_selection_transfer_remove_source( +void xwm_selection_transfer_remove_event_source( struct wlr_xwm_selection_transfer *transfer) { - if (transfer->source != NULL) { - wl_event_source_remove(transfer->source); - transfer->source = NULL; + if (transfer->event_source != NULL) { + wl_event_source_remove(transfer->event_source); + transfer->event_source = NULL; } } -void xwm_selection_transfer_close_source_fd( +void xwm_selection_transfer_close_wl_client_fd( struct wlr_xwm_selection_transfer *transfer) { - if (transfer->source_fd >= 0) { - close(transfer->source_fd); - transfer->source_fd = -1; + if (transfer->wl_client_fd >= 0) { + close(transfer->wl_client_fd); + transfer->wl_client_fd = -1; } } |