aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/selection.c b/selection.c
index 8ed0b6da..2839636a 100644
--- a/selection.c
+++ b/selection.c
@@ -384,13 +384,14 @@ send(void *data, struct wl_data_source *wl_data_source, const char *mime_type,
return;
}
- switch (async_write(fd, selection, len, &(size_t){0})) {
+ size_t async_idx = 0;
+ switch (async_write(fd, selection, len, &async_idx)) {
case ASYNC_WRITE_REMAIN: {
struct clipboard_send *ctx = malloc(sizeof(*ctx));
*ctx = (struct clipboard_send) {
.data = strdup(selection),
.len = len,
- .idx = 0,
+ .idx = async_idx,
};
if (fdm_add(wayl->fdm, fd, EPOLLOUT, &fdm_send, ctx))
@@ -475,13 +476,14 @@ primary_send(void *data,
return;
}
- switch (async_write(fd, selection, len, &(size_t){0})) {
+ size_t async_idx = 0;
+ switch (async_write(fd, selection, len, &async_idx)) {
case ASYNC_WRITE_REMAIN: {
struct clipboard_send *ctx = malloc(sizeof(*ctx));
*ctx = (struct clipboard_send) {
.data = strdup(selection),
.len = len,
- .idx = 0,
+ .idx = async_idx,
};
if (fdm_add(wayl->fdm, fd, EPOLLOUT, &fdm_send, ctx))